[][src]Trait solana_program::program_pack::Pack

pub trait Pack: Sealed {
    const LEN: usize;
    fn get_packed_len() -> usize { ... }
fn unpack(input: &[u8]) -> Result<Self, ProgramError>
    where
        Self: IsInitialized
, { ... }
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError> { ... }
fn pack(src: Self, dst: &mut [u8]) -> Result<(), ProgramError> { ... } }

Safely and efficiently (de)serialize account state

Associated Constants

const LEN: usize

The length, in bytes, of the packed representation

Loading content...

Provided methods

fn get_packed_len() -> usize

Get the packed length

fn unpack(input: &[u8]) -> Result<Self, ProgramError> where
    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 pack(src: Self, dst: &mut [u8]) -> Result<(), ProgramError>

Pack into slice

Loading content...

Implementors

Loading content...