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

Required Methods§

source

fn load<T: ZeroCopy + Owner>(&self) -> Result<&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<&T>

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

Implementors§