[−][src]Trait spl_token::pack::Pack
Safely and efficiently (de)serialize account state
Associated Constants
Loading content...Provided methods
fn get_packed_len() -> usize
Get the packed length
fn unpack(input: &[u8]) -> Result<Self, ProgramError> where
Self: IsInitialized,
Self: IsInitialized,
Unpack from slice and check if initialized
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
Unpack from slice without checking if initialized
fn unpack_mut<F, U>(input: &mut [u8], f: &mut F) -> Result<U, ProgramError> where
F: FnMut(&mut Self) -> Result<U, ProgramError>,
Self: IsInitialized,
F: FnMut(&mut Self) -> Result<U, ProgramError>,
Self: IsInitialized,
Borrow Self
from input
for the duration of the call to f
, but first check that Self
is initialized
fn unpack_unchecked_mut<F, U>(
input: &mut [u8],
f: &mut F
) -> Result<U, ProgramError> where
F: FnMut(&mut Self) -> Result<U, ProgramError>,
input: &mut [u8],
f: &mut F
) -> Result<U, ProgramError> where
F: FnMut(&mut Self) -> Result<U, ProgramError>,
Borrow Self
from input
for the duration of the call to f
, without checking that
Self
has been initialized
fn pack(src: Self, dst: &mut [u8]) -> Result<(), ProgramError>
Pack into slice