Skip to main content

Module storable_primitives

Module storable_primitives 

Source
Expand description

Code generation for primitive type storage implementations.

Structsยง

ArrayConfig ๐Ÿ”’
Configuration for generating array implementations
TypeConfig ๐Ÿ”’
Complete configuration for generating implementations for a type

Enumsยง

StorableConversionStrategy ๐Ÿ”’
Strategy for converting to U256
StorageKeyStrategy ๐Ÿ”’
Strategy for converting to storage key bytes

Constantsยง

ALLOY_INT_SIZES ๐Ÿ”’
RUST_INT_SIZES ๐Ÿ”’

Functionsยง

gen_alloy_integers ๐Ÿ”’
Generate StorableType, Packable, and StorageKey for alloy integer types.
gen_array_impl ๐Ÿ”’
Generate StorableType, Storable, and StorageKey for a fixed-size array.
gen_arrays_for_type ๐Ÿ”’
Generate array implementations for a specific element type
gen_complete_impl_set ๐Ÿ”’
Generate all storage-related impls for a type.
gen_fixed_bytes ๐Ÿ”’
Generate StorableType, Packable, and StorageKey for FixedBytes<N> types.
gen_nested_arrays ๐Ÿ”’
Generate nested array implementations for common small cases
gen_packed_array_load ๐Ÿ”’
Generate load implementation for packed arrays
gen_packed_array_store ๐Ÿ”’
Generate store implementation for packed arrays
gen_storable_alloy_bytes ๐Ÿ”’
Generate StorableType, Packable, and StorageKey for FixedBytes<N> types.
gen_storable_alloy_ints ๐Ÿ”’
Generate StorableType, Packable, and StorageKey for all alloy integer types.
gen_storable_arrays ๐Ÿ”’
Generate StorableType, Storable, and StorageKey for fixed-size arrays of primitive types.
gen_storable_layout_impl ๐Ÿ”’
Generate a StorableType implementation
gen_storable_rust_ints ๐Ÿ”’
Generate StorableType, Packable, and StorageKey for all standard Rust integer types.
gen_storage_key_impl ๐Ÿ”’
Generate a StorageKey implementation based on the conversion strategy
gen_struct_array_impl ๐Ÿ”’
Generate a single array implementation for a user-defined struct.
gen_struct_array_load ๐Ÿ”’
Generate load implementation for struct arrays.
gen_struct_array_store ๐Ÿ”’
Generate store implementation for struct arrays.
gen_struct_arrays ๐Ÿ”’
Generate array implementations for user-defined structs (multi-slot types).
gen_to_word_impl ๐Ÿ”’
Generate FromWord implementation for all primitive types (storage I/O is in Storable).
gen_unpacked_array_load ๐Ÿ”’
Generate load implementation for unpacked arrays
gen_unpacked_array_store ๐Ÿ”’
Generate store implementation for unpacked arrays
is_packable ๐Ÿ”’
Whether a given amount of bytes (primitives only) should be packed, or not.