Trait mpl_core::SolanaAccount

source ·
pub trait SolanaAccount: CrateSerialize + CrateDeserialize {
    // Required method
    fn key() -> Key;

    // Provided methods
    fn load(account: &AccountInfo<'_>, offset: usize) -> Result<Self, Error> { ... }
    fn save(
        &self,
        account: &AccountInfo<'_>,
        offset: usize,
    ) -> Result<(), Error> { ... }
}
Expand description

A trait for Solana accounts.

Required Methods§

source

fn key() -> Key

Get the discriminator key for the account.

Provided Methods§

source

fn load(account: &AccountInfo<'_>, offset: usize) -> Result<Self, Error>

Load the account from the given account info starting at the offset.

source

fn save(&self, account: &AccountInfo<'_>, offset: usize) -> Result<(), Error>

Save the account to the given account info starting at the offset.

Object Safety§

This trait is not object safe.

Implementors§