Trait opentitanlib::util::file::FromReader
source · 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§
sourcefn from_reader(r: impl Read) -> Result<Self>
fn from_reader(r: impl Read) -> Result<Self>
Reads in an instance of Self
.
Provided Methods§
sourcefn read_from_file(path: &Path) -> Result<Self>
fn read_from_file(path: &Path) -> Result<Self>
Reads an instance of Self
from a binary file at path
.