ReadByteable

Trait ReadByteable 

Source
pub trait ReadByteable: Read {
    // Provided method
    fn read_one<T: Byteable>(&mut self) -> Result<T> { ... }
}
Expand description

Extends std::io::Read with a method to read a Byteable type.

Provided Methods§

Source

fn read_one<T: Byteable>(&mut self) -> Result<T>

Reads one Byteable element from the reader.

This method will create a zero-filled byte array, read enough bytes from the underlying reader to fill it, and then convert the byte array into the specified Byteable type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Read> ReadByteable for T

Implements ReadByteable for all types that implement std::io::Read.