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§
fn from_io(read: &mut dyn Read) -> Result<Self>
fn from_vec(vec: &Vec<u8>) -> Result<Self>
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.