pub trait ReadBytes: Read {
// Provided methods
fn read_u8(&mut self) -> Result<u8> { ... }
fn read_u16<T: ByteOrder>(&mut self) -> Result<u16> { ... }
fn read_u24<T: ByteOrder>(&mut self) -> Result<u32> { ... }
fn read_u32<T: ByteOrder>(&mut self) -> Result<u32> { ... }
}
Expand description
A trait for reading bytes with support for different byte orders.
Provided Methods§
Sourcefn read_u8(&mut self) -> Result<u8>
fn read_u8(&mut self) -> Result<u8>
Reads a single 8-bit unsigned integer.
§Returns
Returns a Result
containing the 8-bit integer on success, or an Error
if the read operation fails.
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.