Skip to main content

CurrentLedgerObjectCommonFields

Trait CurrentLedgerObjectCommonFields 

Source
pub trait CurrentLedgerObjectCommonFields {
    // Provided methods
    fn path(&self) -> LedgerPathBuilder { ... }
    fn get_flags(&self) -> Result<u32> { ... }
    fn get_ledger_entry_type(&self) -> Result<u16> { ... }
}
Expand description

Trait providing access to common fields in the current ledger object.

This trait defines methods to access standard fields that are common across different types of ledger objects, specifically for the current ledger object being processed.

Provided Methods§

Source

fn path(&self) -> LedgerPathBuilder

Starts a nested-field path rooted at the current ledger object (no slot).

Use this to reach into arrays and inner objects that the flat getters below can’t return whole. Chain field / index, then get::<T>().

use xrpl_common_stdlib::objects::traits::CurrentLedgerObjectCommonFields;
use xrpl_common_stdlib::sfield;
use xrpl_common_stdlib::types::amount::Amount;
let amount = obj.path().field(sfield::Amount).get::<Amount>();
Source

fn get_flags(&self) -> Result<u32>

Retrieves the flags field of the current ledger object.

§Returns

The flags as a u32 value

Source

fn get_ledger_entry_type(&self) -> Result<u16>

Retrieves the ledger entry type of the current ledger object.

The value 0x0075, mapped to the string Escrow, indicates that this is an Escrow entry.

§Returns

The ledger entry type as a u16 value

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§