pub trait FromStream<S>: Sized {
// Required method
fn from_stream<R: Read>(stream: &mut R) -> Result<Self>;
}Expand description
A trait for types, which can be read from streams.
Required Methods§
Sourcefn from_stream<R: Read>(stream: &mut R) -> Result<Self>
fn from_stream<R: Read>(stream: &mut R) -> Result<Self>
Reads a value of this type from a stream and returns it. Returns an error on failure instead.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".