[][src]Struct bytecodec::combinator::CollectN

pub struct CollectN<D, T> { /* fields omitted */ }

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

This is created by calling DecodeExt::collectn method.

Methods

impl<D, T: Default> CollectN<D, T>[src]

pub fn remaining_items(&self) -> usize[src]

Returns the number of remaining items expected to be decoded.

pub fn set_remaining_items(&mut self, n: usize)[src]

Sets the number of remaining items expected to be decoded.

pub fn inner_ref(&self) -> &D[src]

Returns a reference to the inner decoder.

pub fn inner_mut(&mut self) -> &mut D[src]

Returns a mutable reference to the inner decoder.

pub fn into_inner(self) -> D[src]

Takes ownership of this instance and returns the inner decoder.

Trait Implementations

impl<D: Debug, T: Debug> Debug for CollectN<D, T>[src]

impl<D, T> Decode for CollectN<D, T> where
    D: Decode,
    T: Default + Extend<D::Item>, 
[src]

type Item = T

The type of items to be decoded.

impl<D: Default, T: Default> Default for CollectN<D, T>[src]

Auto Trait Implementations

impl<D, T> RefUnwindSafe for CollectN<D, T> where
    D: RefUnwindSafe,
    T: RefUnwindSafe

impl<D, T> Send for CollectN<D, T> where
    D: Send,
    T: Send

impl<D, T> Sync for CollectN<D, T> where
    D: Sync,
    T: Sync

impl<D, T> Unpin for CollectN<D, T> where
    D: Unpin,
    T: Unpin

impl<D, T> UnwindSafe for CollectN<D, T> where
    D: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.