Trait binary_utils::SyncDataReader
source · pub trait SyncDataReader: Sized {
// Required method
fn read(reader: &mut impl Read) -> Result<Self>;
}Expand description
A trait for types that need to be read from a binary stream synchronously
Implementations of this trait provide a way to read their data
synchronously from a type that implements Read
Required Methods§
sourcefn read(reader: &mut impl Read) -> Result<Self>
fn read(reader: &mut impl Read) -> Result<Self>
Reads data from the provided reader synchronously and constructs an instance of Self.
§Arguments
reader- A mutable reference to a type implementingReadtrait, from which the data will be read.
§Returns
Returns a result containing an instance of Self if the operation is successful, or an error
indicating failure.
Object Safety§
This trait is not object safe.