Skip to main content

from_account_data

Function from_account_data 

Source
pub fn from_account_data<T: Pod + SplDiscriminate>(
    data: &[u8],
) -> Result<&T, AccountDataError>
Expand description

Cast raw account data (including the 8-byte Anchor discriminator) to &T.

Verifies the discriminator matches T::SPL_DISCRIMINATOR before casting.