pub trait FromBytes<'a>: Sized {
// Required method
fn from_bytes(b: &'a [u8]) -> Option<Self>;
}Expand description
A trait for objects that can be parsed from a simple byte stream.
Required Methods§
Sourcefn from_bytes(b: &'a [u8]) -> Option<Self>
fn from_bytes(b: &'a [u8]) -> Option<Self>
Try to read the object from the given bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".