pub trait AnchorDeserialize: Sized {
// Required method
fn deserialize_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read;
// Provided methods
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error> { ... }
fn try_from_slice(v: &[u8]) -> Result<Self, Error> { ... }
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read { ... }
}
Expand description
A data-structure that can be de-serialized from binary format by NBOR.
Required Methods§
fn deserialize_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Provided Methods§
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Object Safety§
This trait is not object safe.