Trait solana_sdk::program_pack::Pack[][src]

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

Safely and efficiently (de)serialize account state

Associated Constants

pub const LEN: usize[src]

The length, in bytes, of the packed representation

Loading content...

Provided methods

pub fn get_packed_len() -> usize[src]

Get the packed length

pub fn unpack(input: &[u8]) -> Result<Self, ProgramError> where
    Self: IsInitialized
[src]

Unpack from slice and check if initialized

pub fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>[src]

Unpack from slice without checking if initialized

pub fn pack(src: Self, dst: &mut [u8]) -> Result<(), ProgramError>[src]

Pack into slice

Loading content...

Implementors

Loading content...