Struct bytecodec::StartDecoderChain [] [src]

pub struct StartDecoderChain;

An object for starting a chain of decoders.

Examples

use bytecodec::{Decode, DecodeExt, StartDecoderChain};
use bytecodec::fixnum::U8Decoder;
use bytecodec::io::IoDecodeExt;

let mut decoder = StartDecoderChain
    .chain(U8Decoder::new())
    .chain(U8Decoder::new())
    .chain(U8Decoder::new());

let mut input = &b"foobar"[..];

let item = decoder.decode_exact(&mut input).unwrap();
assert_eq!(item, (b'f', b'o', b'o'));

let item = decoder.decode_exact(&mut input).unwrap();
assert_eq!(item, (b'b', b'a', b'r'));

Methods

impl StartDecoderChain
[src]

[src]

Starts decoders chain.

Trait Implementations

impl Debug for StartDecoderChain
[src]

[src]

Formats the value using the given formatter. Read more

impl Decode for StartDecoderChain
[src]

The type of items to be decoded.

[src]

Consumes the given buffer (a part of a byte sequence), and decodes an item from it. Read more

[src]

Returns true if the decoder cannot decode items anymore, otherwise false. Read more

[src]

Returns the lower bound of the number of bytes needed to decode the next item. Read more

Auto Trait Implementations