FromBytes

Trait FromBytes 

Source
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§

Source

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", so this trait is not object safe.

Implementors§

Source§

impl<'a, T: Readable<'a>> FromBytes<'a> for T