Struct bytecodec::combinator::Length [−][src]
pub struct Length<C> { /* fields omitted */ }
Expand description
Combinator for consuming the specified number of bytes exactly.
This is created by calling {DecodeExt, EncodeExt}::length
method.
Implementations
Returns the number of bytes expected to be consumed for decoding an item.
Sets the number of bytes expected to be consumed for decoding an item.
Errors
If it is in the middle of decoding an item, it willl return an ErrorKind::IncompleteDecoding
error.
Returns the number of remaining bytes required to decode the next item.
Returns a mutable reference to the inner encoder or decoder.
Takes ownership of this instance and returns the inner encoder or decoder.
Trait Implementations
Returns the exact number of bytes required to encode all the items remaining in the encoder.
Auto Trait Implementations
impl<C> RefUnwindSafe for Length<C> where
C: RefUnwindSafe,
impl<C> UnwindSafe for Length<C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Encodes the items remaining in the encoder and writes the encoded bytes to the given write buffer. Read more
Encodes the items remaining in the encoder and
writes the encoded bytes to the given write buffer.
If the write buffer is full and the writing cannot be performed,
the given WriteBuf will memorize cx’s Waker
.
This Waker
’s wake
will later be called when the WriteBuf
regains its free space. Read more