Struct solana_sdk::account::Account
source · #[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 Account with data that is stored on chain
Fields§
§lamports: u64
lamports in the account
data: Vec<u8>
data held in this account
owner: Pubkey
the program that owns this account. If executable, the program that loads this account.
executable: bool
this account’s data contains a loaded program (and is now read-only)
rent_epoch: Epoch
the epoch at which this account will next owe rent
Implementations§
source§impl Account
impl Account
pub fn new(lamports: u64, space: usize, owner: &Pubkey) -> Self
pub fn new_ref(lamports: u64, space: usize, owner: &Pubkey) -> Rc<RefCell<Self>>
pub fn new_data<T: Serialize>( lamports: u64, state: &T, owner: &Pubkey ) -> Result<Self, Error>
pub fn new_ref_data<T: Serialize>( lamports: u64, state: &T, owner: &Pubkey ) -> Result<RefCell<Self>, Error>
pub fn new_data_with_space<T: Serialize>( lamports: u64, state: &T, space: usize, owner: &Pubkey ) -> Result<Self, Error>
pub fn new_ref_data_with_space<T: Serialize>( lamports: u64, state: &T, space: usize, owner: &Pubkey ) -> Result<RefCell<Self>, Error>
pub fn new_rent_epoch( lamports: u64, space: usize, owner: &Pubkey, rent_epoch: Epoch ) -> Self
pub fn deserialize_data<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn serialize_data<T: Serialize>(&mut self, state: &T) -> Result<(), Error>
Trait Implementations§
source§impl Account for Account
impl Account for Account
Return the information required to construct an AccountInfo
. Used by the
AccountInfo
conversion implementations.
source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§fn from(other: AccountSharedData) -> Self
fn from(other: AccountSharedData) -> Self
Converts to this type from the input type.