pub trait FromReader: Sized {
    // Required method
    fn from_reader(r: impl Read) -> Result<Self>;

    // Provided method
    fn read_from_file(path: &Path) -> Result<Self> { ... }
}
Expand description

Trait for data types that can be streamed to a reader.

Required Methods§

source

fn from_reader(r: impl Read) -> Result<Self>

Reads in an instance of Self.

Provided Methods§

source

fn read_from_file(path: &Path) -> Result<Self>

Reads an instance of Self from a binary file at path.

Implementors§