Expand description
Shared code generation utilities for storage slot packing.
This module provides common logic for computing slot and offset assignments
used by both the #[derive(Storable)] and #[contract] macros.
Structsยง
- Layout
Field ๐ - A single field in the storage layout with computed slot information.
- Packing
Constants ๐ - Helper for generating packing constant identifiers
Enumsยง
- Slot
Assignment ๐ - Represents how a slot is assigned
Functionsยง
- allocate_
slots ๐ - Build layout IR from field information.
- classify_
field_ ๐type - Classify a field based on its type.
- const_
name ๐ - Convert a field name to a constant name (SCREAMING_SNAKE_CASE)
- gen_
collision_ ๐check_ fn - Generate collision detection debug assertions for a field against all other fields.
- gen_
constants_ ๐from_ ir - Generate packing constants from layout IR.
- gen_
layout_ ๐ctx_ expr - Generate a
LayoutCtxexpression for accessing a field. - gen_
layout_ ๐ctx_ expr_ inefficient - Generate a
LayoutCtxexpression for accessing a field. - gen_
slot_ ๐packing_ logic - Generate slot packing decision logic.