pub fn get_field_optional<T: FromLedger, const CODE: i32>(
slot: i32,
field: SField<T, CODE>,
) -> Result<Option<T>>Expand description
Retrieves an optionally present field from the ledger object cached in slot.
ยงReturns
Returns a Result<Option<T>> where:
Ok(Some(T))- The field value for the specified fieldOk(None)- If the field is not present (i.e., result_code == FIELD_NOT_FOUND)Err(Error)- If the field cannot be retrieved, has unexpected size, or fails to decode