[][src]Struct bytecodec::combinator::Omittable

pub struct Omittable<D> { /* fields omitted */ }

Combinator for representing optional decoders.

This is created by calling DecodeExt::omit method.

Methods

impl<D> Omittable<D>[src]

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.

pub fn do_omit(&mut self, b: bool)[src]

If true is specified, the decoder will consume no bytes and return Ok((0, None)) when decode method is called.

pub fn will_omit(&self) -> bool[src]

Returns true if the decoder will omit to decode items, otherwise false.

Trait Implementations

impl<D: Debug> Debug for Omittable<D>[src]

impl<D: Decode> Decode for Omittable<D>[src]

type Item = Option<D::Item>

The type of items to be decoded.

impl<D: Default> Default for Omittable<D>[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for Omittable<D> where
    D: RefUnwindSafe

impl<D> Send for Omittable<D> where
    D: Send

impl<D> Sync for Omittable<D> where
    D: Sync

impl<D> Unpin for Omittable<D> where
    D: Unpin

impl<D> UnwindSafe for Omittable<D> where
    D: 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.