pub trait ReadableAccount: Sized {
// Required methods
fn lamports(&self) -> u64;
fn data(&self) -> &[u8] ⓘ;
fn owner(&self) -> &Pubkey;
fn executable(&self) -> bool;
fn rent_epoch(&self) -> u64;
// Provided method
fn to_account_shared_data(&self) -> AccountSharedData { ... }
}Required Methods§
fn lamports(&self) -> u64
fn data(&self) -> &[u8] ⓘ
fn owner(&self) -> &Pubkey
fn executable(&self) -> bool
fn rent_epoch(&self) -> u64
Provided Methods§
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.
Implementations on Foreign Types§
Source§impl ReadableAccount for Ref<'_, Account>
impl ReadableAccount for Ref<'_, Account>
Source§impl<'a> ReadableAccount for LoadedAccount<'a>
impl<'a> ReadableAccount for LoadedAccount<'a>
Source§impl<'accounts_file, M> ReadableAccount for TieredReadableAccount<'accounts_file, M>where
M: TieredAccountMeta,
impl<'accounts_file, M> ReadableAccount for TieredReadableAccount<'accounts_file, M>where
M: TieredAccountMeta,
Source§fn executable(&self) -> bool
fn executable(&self) -> bool
Returns true if the data associated to this account is executable.
Temporarily unimplemented!() as program runtime v2 will use a different API for executable.
Source§fn rent_epoch(&self) -> u64
fn rent_epoch(&self) -> u64
Returns the epoch that this account will next owe rent by parsing the specified account block. Epoch::MAX will be returned if the account is rent-exempt.