DefaultFromRead

Trait DefaultFromRead 

Source
pub trait DefaultFromRead: Sized + Sealed {
    // Required methods
    fn from_io(read: &mut dyn Read) -> Result<Self>;
    fn from_vec(vec: &Vec<u8>) -> Result<Self>;
    fn from_slice(slice: &[u8]) -> Result<Self>;
}
Expand description

Auto implemented trait to add constructors to all structs that provide a Default impl. This trait is sealed and cannot be implemented manually.

Required Methods§

Source

fn from_io(read: &mut dyn Read) -> Result<Self>

Source

fn from_vec(vec: &Vec<u8>) -> Result<Self>

Source

fn from_slice(slice: &[u8]) -> 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.

Implementors§

Source§

impl<T> DefaultFromRead for T
where T: FromRead + Default,