pub trait Read<'a> {
type Error: Debug + Display;
// Required method
fn read_map<R, F>(&mut self, n: usize, f: F) -> Result<R, Self::Error>
where F: FnOnce(Bytes<'a, '_>) -> R;
// Provided method
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Self::Error> { ... }
}
Expand description
Interface to read bytes
Required Associated Types§
Required Methods§
Provided Methods§
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.