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§

Get the Key for this Account. This key is to be stored in the first byte of the Account data.

Provided Methods§

BorshDeserialize the AccountInfo into the Rust data structure.

BorshSerialize the Rust data structure into the Account data.

Implementors§