Skip to main content

LedgerObjectCommonFields

Trait LedgerObjectCommonFields 

Source
pub trait LedgerObjectCommonFields {
    // Required method
    fn get_slot_num(&self) -> i32;

    // 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 present in all ledger objects.

This trait defines methods to access standard fields that are common across different types of ledger objects in the XRP Ledger.

Required Methods§

Source

fn get_slot_num(&self) -> i32

Returns the slot number (register number) where the ledger object is stored.

This number is used to identify and access the specific ledger object when retrieving or modifying its fields.

§Returns

The slot number as an i32 value

Provided Methods§

Source

fn path(&self) -> LedgerPathBuilder

Starts a nested-field path rooted at this ledger object, read through its slot.

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

use xrpl_common_stdlib::objects::traits::LedgerObjectCommonFields;
use xrpl_common_stdlib::sfield;
use xrpl_common_stdlib::types::account_id::AccountID;
let signer = obj.path()
    .field(sfield::SignerEntries)
    .index(0)
    .field(sfield::Account)
    .get::<AccountID>();
Source

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

Retrieves the flags field of the ledger object.

§Arguments
  • register_num - The register number where the ledger object is stored
§Returns

The flags as a u32 value

Source

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

Retrieves the ledger entry type of the 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§

Source§

impl LedgerObjectCommonFields for AMM

Source§

impl LedgerObjectCommonFields for AccountRoot

Source§

impl LedgerObjectCommonFields for Amendments

Source§

impl LedgerObjectCommonFields for Bridge

Source§

impl LedgerObjectCommonFields for Check

Source§

impl LedgerObjectCommonFields for Credential

Source§

impl LedgerObjectCommonFields for DID

Source§

impl LedgerObjectCommonFields for Delegate

Source§

impl LedgerObjectCommonFields for DepositPreauth

Source§

impl LedgerObjectCommonFields for DirectoryNode

Source§

impl LedgerObjectCommonFields for Escrow

Source§

impl LedgerObjectCommonFields for FeeSettings

Source§

impl LedgerObjectCommonFields for LedgerHashes

Source§

impl LedgerObjectCommonFields for LedgerObject

Source§

impl LedgerObjectCommonFields for Loan

Source§

impl LedgerObjectCommonFields for LoanBroker

Source§

impl LedgerObjectCommonFields for MPToken

Source§

impl LedgerObjectCommonFields for MPTokenIssuance

Source§

impl LedgerObjectCommonFields for NFTokenOffer

Source§

impl LedgerObjectCommonFields for NFTokenPage

Source§

impl LedgerObjectCommonFields for NegativeUNL

Source§

impl LedgerObjectCommonFields for Offer

Source§

impl LedgerObjectCommonFields for Oracle

Source§

impl LedgerObjectCommonFields for PayChannel

Source§

impl LedgerObjectCommonFields for PermissionedDomain

Source§

impl LedgerObjectCommonFields for RippleState

Source§

impl LedgerObjectCommonFields for SignerList

Source§

impl LedgerObjectCommonFields for Sponsorship

Source§

impl LedgerObjectCommonFields for Ticket

Source§

impl LedgerObjectCommonFields for Vault

Source§

impl LedgerObjectCommonFields for XChainOwnedClaimID

Source§

impl LedgerObjectCommonFields for XChainOwnedCreateAccountClaimID