Trait anchor_lang::AnchorDeserialize
source · [−]pub trait AnchorDeserialize {
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>;
fn try_from_slice(v: &[u8]) -> Result<Self, Error> { ... }
fn is_u8() -> bool { ... }
}
Expand description
Borsh is the default serialization format for instructions and accounts. A data-structure that can be de-serialized from binary format by NBOR.
Required methods
Provided methods
Deserialize this instance from a slice 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.