Skip to main content

get_neighbor_slot_refs

Function get_neighbor_slot_refs 

Source
pub(crate) fn get_neighbor_slot_refs<T, F>(
    idx: usize,
    fields: &[T],
    packing: &Ident,
    get_name: F,
    use_full_slot: bool,
) -> (Option<TokenStream>, Option<TokenStream>)
where F: Fn(&T) -> &Ident,
Expand description

Helper to compute prev and next slot constant references for a field at a given index.

Generic over the field type - uses a closure to extract the field name.

  • use_full_slot=true: returns *_SLOT (U256) for contracts
  • use_full_slot=false: returns *_LOC.offset_slots (usize) for storable structs