Skip to main content

get_field_optional

Function get_field_optional 

Source
pub fn get_field_optional<T: CurrentTxFieldGetter, F: Into<i32>>(
    field_code: F,
) -> Result<Option<T>>
Expand description

Retrieves an optionally present field from the current transaction.

§Arguments

  • field_code - The field code identifying which field to retrieve (can be an i32 or SField)

§Returns

Returns a Result<Option<T>> where:

  • Ok(Some(T)) - The field value for the specified field
  • Ok(None) - If the field is not present
  • Err(Error) - If the field cannot be retrieved or has unexpected size