gen_handler_field_init

Function gen_handler_field_init 

Source
pub(crate) fn gen_handler_field_init(
    field: &LayoutField<'_>,
    field_idx: usize,
    all_fields: &[LayoutField<'_>],
    packing_mod: Option<&Ident>,
) -> TokenStream
Expand description

Generates handler field initialization expression

§Parameters

  • field: the field to initialize
  • field_idx: the field’s index in the allocated fields array
  • all_fields: all allocated fields (for neighbor slot detection)
  • packing_mod: optional packing module identifier
    • None = contract storage (uses slots module, inefficient layout)
    • Some(mod_ident) = storable struct (uses packing module, efficient layout, offsets from base_slot)