Trait mpl_token_auth_rules::state::SolanaAccount
source · pub trait SolanaAccount: BorshSerialize + BorshDeserialize {
fn key() -> Key;
fn from_account_info(
account: &AccountInfo<'_>
) -> Result<Self, ProgramError> { ... }
fn to_account_data(&self, account: &AccountInfo<'_>) -> ProgramResult { ... }
}
Expand description
A trait implementing generic functions required by all accounts on Solana.
Required Methods§
Provided Methods§
sourcefn from_account_info(account: &AccountInfo<'_>) -> Result<Self, ProgramError>
fn from_account_info(account: &AccountInfo<'_>) -> Result<Self, ProgramError>
BorshDeserialize the AccountInfo
into the Rust data structure.
sourcefn to_account_data(&self, account: &AccountInfo<'_>) -> ProgramResult
fn to_account_data(&self, account: &AccountInfo<'_>) -> ProgramResult
BorshSerialize the Rust data structure into the Account
data.