/// Returns a Ref to the account data structure for reading.
Returns a Ref to the account data structure for reading.
Returns a Ref to the account data structure for reading .
pub fn load(&self) -> Result<Ref<T>, ProgramError> {
        let data = self.acc_info.try_borrow_data()?;
        let mut disc_bytes = [0u8; 8];
        disc_bytes.copy_from_slice(&data[..8]);
        if disc_bytes != T::discriminator() {
            return Err(ErrorCode::AccountDiscriminatorMismatch.into());
        }
        Ok(Ref::map(data, |data| bytemuck::from_bytes(&data[8..])))
    }
pub fn load ( & self ) -> Result < Ref < T > , ProgramError > { let data = self . acc_info . try_borrow_data ( ) ? ; let mut disc_bytes = [ 0u8 ; 8 ] ; disc_bytes . copy_from_slice ( & data [ .. 8 ] ) ; if disc_bytes != T :: discriminator ( ) { return Err ( ErrorCode :: AccountDiscriminatorMismatch . into ( ) ) ; } Ok ( Ref :: map ( data , | data | bytemuck :: from_bytes ( & data [ 8 .. ] ) ) ) }
Returns a Ref to the account data structure for reading.
Returns a Ref to the account data structure for reading .
&self