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