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 account_hash<'a>( &self, _account_block: &'a [u8], ) -> Option<&'a AccountHash>; 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 account_hash<'a>(&self, _account_block: &'a [u8]) -> Option<&'a AccountHash>

Returns the account hash by parsing the specified account block. None will be returned if this account does not persist this optional field.

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.

Object Safety§

This trait is not object safe.

Implementors§