Trait mango_v4::accounts_zerocopy::LoadZeroCopy
source · 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§
sourcefn load<T: ZeroCopy + Owner>(&self) -> Result<&T>
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.
sourcefn load_fully_unchecked<T: ZeroCopy + Owner>(&self) -> Result<&T>
fn load_fully_unchecked<T: ZeroCopy + Owner>(&self) -> Result<&T>
Same as load(), but doesn’t check the discriminator or owner.