pub trait BorshDeserialize: Sized {
// Required method
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>;
// Provided methods
fn deserialize(buf: &mut &[u8]) -> Result<Self> { ... }
fn try_from_slice(v: &[u8]) -> Result<Self> { ... }
fn try_from_reader<R: Read>(reader: &mut R) -> Result<Self> { ... }
}
Expand description
A data-structure that can be de-serialized from binary format by NBOR.
Required Methods§
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>
Provided Methods§
Sourcefn deserialize(buf: &mut &[u8]) -> Result<Self>
fn deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
Sourcefn try_from_slice(v: &[u8]) -> Result<Self>
fn try_from_slice(v: &[u8]) -> Result<Self>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R: Read>(reader: &mut R) -> Result<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.