Module bytecodec::combinator [] [src]

Encoders and decoders for combination.

These are mainly created via the methods provided by EncodeExt or DecodeExt traits.

Structs

AndThen

Combinator for conditional decoding.

Assert

Combinator for declaring an assertion about decoded items.

Buffered

Combinator that gives a buffer to the decoder.

Collect

Combinator for collecting decoded items.

CollectN

Combinator for decoding the specified number of items and collecting the result.

DecoderChain

Combinator for connecting decoders to a chain.

EncoderChain

Combinator for connecting encoders to a chain.

Last

Combinator for representing encoders that cannot accept any more items.

LastItem

Combinator for representing encoders that accepts only one additional item.

Length

Combinator for consuming the specified number of bytes exactly.

Map

Combinator for converting decoded items to other values.

MapErr

Combinator for modifying encoding/decoding errors.

MapFrom

Combinator for converting items into ones that suited to the inner encoder by calling the given function.

MaxBytes

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

MaybeEos

Combinator for ignoring EOS if there is no item being decoded.

Omittable

Combinator for representing optional decoders.

Optional

Combinator for representing an optional encoder.

Padding

Combinator that keeps writing padding byte until it reaches EOS after encoding of E's item has been completed.

PreEncode

Combinator for pre-encoding items when start_encoding method is called.

Repeat

Combinator for repeating encoding of E::Item.

SkipRemaining

Combinator for skipping the remaining bytes in an input byte sequence after decoding an item by using D.

Slice

Combinator for slicing an input/output byte sequence by the specified number of bytes.

TryMap

Combinator which tries to convert decoded values by calling the specified function.

TryMapFrom

Combinator that tries to convert items into ones that suited to the inner encoder by calling the given function.

WithPrefix

Combinator for adding prefix items.