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§
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 final_rent_epoch(&self, account_block: &[u8]) -> Epoch
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.
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.
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.