Skip to main content

get_field

Function get_field 

Source
pub fn get_field<T: FromLedger, const CODE: i32>(
    slot: i32,
    _: SField<T, CODE>,
) -> Result<T>
Expand description

Retrieves a field from the ledger object cached in slot using an SField constant.

ยงReturns

Returns a Result<T> where:

  • Ok(T) - The field value for the specified field
  • Err(Error) - If the field cannot be retrieved, has unexpected size, or fails to decode