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§
sourcefn with_lamports(self, lamports: u64) -> Self
fn with_lamports(self, lamports: u64) -> Self
A builder function that initializes lamports.
sourcefn with_account_data_padding(self, padding: u8) -> Self
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.
sourcefn with_owner_offset(self, owner_offset: OwnerOffset) -> Self
fn with_owner_offset(self, owner_offset: OwnerOffset) -> Self
A builder function that initializes the owner offset.
sourcefn with_account_data_size(self, account_data_size: u64) -> Self
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.
sourcefn with_flags(self, flags: &AccountMetaFlags) -> Self
fn with_flags(self, flags: &AccountMetaFlags) -> Self
A builder function that initializes the AccountMetaFlags of the current meta.
sourcefn account_data_padding(&self) -> u8
fn account_data_padding(&self) -> u8
Returns the number of padding bytes for the associated account data
sourcefn owner_offset(&self) -> OwnerOffset
fn owner_offset(&self) -> OwnerOffset
Returns the offset to the accounts’ owner in the current AccountsFile.
sourcefn flags(&self) -> &AccountMetaFlags
fn flags(&self) -> &AccountMetaFlags
Returns the AccountMetaFlags of the current meta.
Returns true if the TieredAccountMeta implementation supports multiple accounts sharing one account block.
sourcefn rent_epoch(&self, _account_block: &[u8]) -> Option<Epoch>
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.
sourcefn account_hash<'a>(&self, _account_block: &'a [u8]) -> Option<&'a AccountHash>
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.
sourcefn optional_fields_offset(&self, _account_block: &[u8]) -> usize
fn optional_fields_offset(&self, _account_block: &[u8]) -> usize
Returns the offset of the optional fields based on the specified account block.
sourcefn account_data_size(&self, _account_block: &[u8]) -> usize
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.
sourcefn account_data<'a>(&self, _account_block: &'a [u8]) -> &'a [u8] ⓘ
fn account_data<'a>(&self, _account_block: &'a [u8]) -> &'a [u8] ⓘ
Returns the data associated to this account based on the specified account block.