pub trait LoadZeroCopyRef {
    // Required methods
    fn load<T: ZeroCopy + Owner>(&self) -> Result<Ref<'_, T>>;
    fn load_fully_unchecked<T: ZeroCopy + Owner>(&self) -> Result<Ref<'_, T>>;
}

Required Methods§

source

fn load<T: ZeroCopy + Owner>(&self) -> Result<Ref<'_, T>>

Using AccountLoader forces a AccountInfo.clone() and then binds the loaded lifetime to the AccountLoader’s lifetime. This function avoids both. It checks the account owner and discriminator, then casts the data.

source

fn load_fully_unchecked<T: ZeroCopy + Owner>(&self) -> Result<Ref<'_, T>>

Same as load(), but doesn’t check the discriminator or owner.

Implementations on Foreign Types§

source§

impl<'info> LoadZeroCopyRef for AccountInfo<'info>

source§

fn load<T: ZeroCopy + Owner>(&self) -> Result<Ref<'_, T>>

source§

fn load_fully_unchecked<T: ZeroCopy + Owner>(&self) -> Result<Ref<'_, T>>

Implementors§