pub trait FromRead: Sized {
// Required method
fn from_read<R: Read>(r: R) -> ProcResult<Self>;
// Provided method
fn from_file<P: AsRef<Path>>(path: P) -> ProcResult<Self> { ... }
}
Expand description
Types which can be parsed from a Read implementation.
Required Methods§
sourcefn from_read<R: Read>(r: R) -> ProcResult<Self>
fn from_read<R: Read>(r: R) -> ProcResult<Self>
Read the type from a Read.
Provided Methods§
sourcefn from_file<P: AsRef<Path>>(path: P) -> ProcResult<Self>
fn from_file<P: AsRef<Path>>(path: P) -> ProcResult<Self>
Read the type from a file.
Object Safety§
This trait is not object safe.