pub trait Read {
// Required method
fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
// Provided methods
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()> { ... }
fn read_to_end(&mut self, out: &mut Vec<u8>) -> Result<usize> { ... }
fn take(self, limit: u64) -> Take<Self>
where Self: Sized { ... }
fn by_ref(&mut self) -> &mut Self
where Self: Sized { ... }
fn bytes(self) -> Bytes<Self> ⓘ
where Self: Sized { ... }
}Required Methods§
Provided Methods§
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
fn read_to_end(&mut self, out: &mut Vec<u8>) -> Result<usize>
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn bytes(self) -> Bytes<Self> ⓘwhere
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".