pub trait AnchorSerialize {
    fn serialize<W>(&self, writer: &mut W) -> Result<(), Error>
    where
        W: Write
; fn try_to_vec(&self) -> Result<Vec<u8, Global>, Error> { ... } fn is_u8() -> bool { ... } }
Expand description

Borsh is the default serialization format for instructions and accounts. A data-structure that can be serialized into binary format by NBOR.

Required methods

Provided methods

Serialize this instance into a vector of bytes.

Whether Self is u8. NOTE: Vec<u8> is the most common use-case for serialization and deserialization, it’s worth handling it as a special case to improve performance. It’s a workaround for specific Vec<u8> implementation versus generic Vec<T> implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details.

Implementations on Foreign Types

Implementors