Struct bytecodec::combinator::MaxBytes [] [src]

pub struct MaxBytes<C> { /* fields omitted */ }

Combinator that will fail if the number of consumed bytes exceeds the specified size.

This is created by calling {DecodeExt, EncodeExt}::max_bytes method.

Trait Implementations

impl<C: Debug> Debug for MaxBytes<C>
[src]

[src]

Formats the value using the given formatter. Read more

impl<D: Decode> Decode for MaxBytes<D>
[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

impl<E: Encode> Encode for MaxBytes<E>
[src]

The type of items to be encoded.

[src]

Encodes the items in the encoder and writes the encoded bytes to the given buffer. Read more

[src]

Tries to start encoding the given item. Read more

[src]

Returns the number of bytes required to encode all the items in the encoder. Read more

[src]

Returns true if there are no items to be encoded in the encoder, otherwise false.

impl<E: ExactBytesEncode> ExactBytesEncode for MaxBytes<E>
[src]

[src]

Returns the exact number of bytes required to encode all the items remaining in the encoder.

Auto Trait Implementations

impl<C> Send for MaxBytes<C> where
    C: Send

impl<C> Sync for MaxBytes<C> where
    C: Sync