#[repr(C)]pub struct Account {
pub lamports: u64,
pub data: Vec<u8>,
pub owner: Pubkey,
pub executable: bool,
pub rent_epoch: Epoch,
}Expand description
An on-chain account with owned data and an explicit rent epoch.
Fields§
§lamports: u64Lamports in the account.
data: Vec<u8>Data held in the account.
owner: PubkeyThe program that owns this account.
executable: boolWhether the account contains executable program data.
rent_epoch: EpochThe epoch at which this account next owes rent.
Implementations§
Trait Implementations§
impl Eq for Account
Source§impl From<Account> for OwnedAccount
impl From<Account> for OwnedAccount
Source§impl From<Account> for AccountBuilder
impl From<Account> for AccountBuilder
Source§fn from(other: AccountSharedData) -> Self
fn from(other: AccountSharedData) -> Self
Converts to this type from the input type.
Source§impl ReadableAccount for Account
impl ReadableAccount for Account
Source§fn executable(&self) -> bool
fn executable(&self) -> bool
Returns whether the account is executable.
Source§fn rent_epoch(&self) -> Epoch
fn rent_epoch(&self) -> Epoch
Returns the rent epoch view for this account.
impl StructuralPartialEq for Account
Source§impl WritableAccount for Account
impl WritableAccount for Account
Source§fn set_lamports(&mut self, lamports: u64)
fn set_lamports(&mut self, lamports: u64)
Replaces the lamport balance.
Source§fn data_as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn data_as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns mutable access to the account data.
Source§fn copy_into_owner_from_slice(&mut self, source: &[u8])
fn copy_into_owner_from_slice(&mut self, source: &[u8])
Copies 32 raw bytes into the owner pubkey.
Source§fn set_executable(&mut self, executable: bool)
fn set_executable(&mut self, executable: bool)
Sets the executable flag.
Source§fn set_rent_epoch(&mut self, epoch: Epoch)
fn set_rent_epoch(&mut self, epoch: Epoch)
Sets the rent epoch view if the implementation stores one. Read more
Source§fn checked_add_lamports(&mut self, lamports: u64) -> Result<(), LamportsError>
fn checked_add_lamports(&mut self, lamports: u64) -> Result<(), LamportsError>
Adds lamports or returns an overflow error.
Source§fn checked_sub_lamports(&mut self, lamports: u64) -> Result<(), LamportsError>
fn checked_sub_lamports(&mut self, lamports: u64) -> Result<(), LamportsError>
Subtracts lamports or returns an underflow error.
Source§fn saturating_add_lamports(&mut self, lamports: u64)
fn saturating_add_lamports(&mut self, lamports: u64)
Adds lamports and saturates on overflow.
Source§fn saturating_sub_lamports(&mut self, lamports: u64)
fn saturating_sub_lamports(&mut self, lamports: u64)
Subtracts lamports and saturates on underflow.
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnsafeUnpin for Account
impl UnwindSafe for Account
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more