pub trait ReadExt: Read {
// Provided methods
fn read_u8(&mut self) -> Result<u8, Error> { ... }
fn read_u16(&mut self) -> Result<u16, Error> { ... }
fn read_u32(&mut self) -> Result<u32, Error> { ... }
fn read_u64(&mut self) -> Result<u64, Error> { ... }
fn read_slice(&mut self, slice: &mut [u8]) -> Result<(), Error> { ... }
fn read_byte_array<const N: usize>(&mut self) -> Result<[u8; N], Error> { ... }
fn read_compact_size(&mut self) -> Result<u64, Error> { ... }
}Expand description
Utility trait to read some primitive values into our encoding format.
Provided Methods§
Sourcefn read_slice(&mut self, slice: &mut [u8]) -> Result<(), Error>
fn read_slice(&mut self, slice: &mut [u8]) -> Result<(), Error>
Read from the writer to fill the entire slice.
Sourcefn read_compact_size(&mut self) -> Result<u64, Error>
fn read_compact_size(&mut self) -> Result<u64, Error>
Read a value in compact size aka “VarInt” encoding.
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.