pub trait Read<T> {
// Required method
fn read(&mut self, buf: &mut dyn AsMut<[T]>) -> Result<usize>;
// Provided method
fn read_exact(&mut self, buf: &mut dyn AsMut<[T]>) -> Result<()> { ... }
}Required Methods§
Provided Methods§
Sourcefn read_exact(&mut self, buf: &mut dyn AsMut<[T]>) -> Result<()>
fn read_exact(&mut self, buf: &mut dyn AsMut<[T]>) -> Result<()>
Reads the full buffer from this source. Might block if the
implementation of Read::read blocks. If this returns
Result::Ok, then the full buffer has been read. If it
returns Result::Err, then either an error occurred during
Read::read or the source is at EOF, in which case
Error::PrematureEndOfInput is returned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".