pub trait IoDecodeExt: Decode {
// Provided methods
fn decode_from_read_buf<B>(&mut self, buf: &mut ReadBuf<B>) -> Result<()>
where B: AsRef<[u8]> { ... }
fn decode_exact<R: Read>(&mut self, reader: R) -> Result<Self::Item> { ... }
}
Expand description
An extension of Decode
trait to aid decodings involving I/O.
Provided Methods§
Sourcefn decode_from_read_buf<B>(&mut self, buf: &mut ReadBuf<B>) -> Result<()>
fn decode_from_read_buf<B>(&mut self, buf: &mut ReadBuf<B>) -> Result<()>
Consumes bytes from the given read buffer and proceeds the decoding process.
Sourcefn decode_exact<R: Read>(&mut self, reader: R) -> Result<Self::Item>
fn decode_exact<R: Read>(&mut self, reader: R) -> Result<Self::Item>
Decodes an item from the given reader.
This method reads only minimal bytes required to decode an item.
Note that this is a blocking method.
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.