pub trait Deserializable: Sized {
// Required method
fn deserialize(buf: Buffer<'_, '_>) -> Result<Self>;
// Provided method
fn from_bytes(bytes: &[u8]) -> Result<Self> { ... }
}Expand description
Deserialize a value from TL binary format.
Required Methods§
Sourcefn deserialize(buf: Buffer<'_, '_>) -> Result<Self>
fn deserialize(buf: Buffer<'_, '_>) -> Result<Self>
Read Self from buf, advancing its position.
Provided Methods§
Sourcefn from_bytes(bytes: &[u8]) -> Result<Self>
fn from_bytes(bytes: &[u8]) -> Result<Self>
Convenience: deserialize from a byte slice.
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.