[][src]Trait bytecodec::io::IoDecodeExt

pub trait IoDecodeExt: Decode {
    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> { ... } }

An extension of Decode trait to aid decodings involving I/O.

Provided methods

fn decode_from_read_buf<B>(&mut self, buf: &mut ReadBuf<B>) -> Result<()> where
    B: AsRef<[u8]>, 

Consumes bytes from the given read buffer and proceeds the decoding process.

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.

Loading content...

Implementors

impl<T: Decode> IoDecodeExt for T[src]

Loading content...