solana_accounts_db::tiered_storage::meta

Trait TieredAccountMeta

Source
pub trait TieredAccountMeta: Sized {
Show 16 methods // Required methods fn new() -> Self; fn with_lamports(self, lamports: u64) -> Self; fn with_account_data_padding(self, padding: u8) -> Self; fn with_owner_offset(self, owner_offset: OwnerOffset) -> Self; fn with_account_data_size(self, account_data_size: u64) -> Self; fn with_flags(self, flags: &AccountMetaFlags) -> Self; fn lamports(&self) -> u64; fn account_data_padding(&self) -> u8; fn owner_offset(&self) -> OwnerOffset; fn flags(&self) -> &AccountMetaFlags; fn supports_shared_account_block() -> bool; fn rent_epoch(&self, _account_block: &[u8]) -> Option<Epoch>; fn final_rent_epoch(&self, account_block: &[u8]) -> Epoch; fn optional_fields_offset(&self, _account_block: &[u8]) -> usize; fn account_data_size(&self, _account_block: &[u8]) -> usize; fn account_data<'a>(&self, _account_block: &'a [u8]) -> &'a [u8] ;
}
Expand description

A trait that allows different implementations of the account meta that support different tiers of the accounts storage.

Required Methods§

Source

fn new() -> Self

Constructs a TieredAcountMeta instance.

Source

fn with_lamports(self, lamports: u64) -> Self

A builder function that initializes lamports.

Source

fn with_account_data_padding(self, padding: u8) -> Self

A builder function that initializes the number of padding bytes for the account data associated with the current meta.

Source

fn with_owner_offset(self, owner_offset: OwnerOffset) -> Self

A builder function that initializes the owner offset.

Source

fn with_account_data_size(self, account_data_size: u64) -> Self

A builder function that initializes the account data size. The size here represents the logical data size without compression.

Source

fn with_flags(self, flags: &AccountMetaFlags) -> Self

A builder function that initializes the AccountMetaFlags of the current meta.

Source

fn lamports(&self) -> u64

Returns the balance of the lamports associated with the account.

Source

fn account_data_padding(&self) -> u8

Returns the number of padding bytes for the associated account data

Source

fn owner_offset(&self) -> OwnerOffset

Returns the offset to the accounts’ owner in the current AccountsFile.

Source

fn flags(&self) -> &AccountMetaFlags

Returns the AccountMetaFlags of the current meta.

Source

fn supports_shared_account_block() -> bool

Returns true if the TieredAccountMeta implementation supports multiple accounts sharing one account block.

Source

fn rent_epoch(&self, _account_block: &[u8]) -> Option<Epoch>

Returns the epoch that this account will next owe rent by parsing the specified account block. None will be returned if this account does not persist this optional field.

Source

fn final_rent_epoch(&self, account_block: &[u8]) -> Epoch

Returns the epoch that this account will next owe rent by parsing the specified account block. RENT_EXEMPT_RENT_EPOCH will be returned if the account is rent-exempt.

For a zero-lamport account, Epoch::default() will be returned to default states of an AccountSharedData.

Source

fn optional_fields_offset(&self, _account_block: &[u8]) -> usize

Returns the offset of the optional fields based on the specified account block.

Source

fn account_data_size(&self, _account_block: &[u8]) -> usize

Returns the length of the data associated to this account based on the specified account block.

Source

fn account_data<'a>(&self, _account_block: &'a [u8]) -> &'a [u8]

Returns the data associated to this account based on the specified account block.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§