Struct bytecodec::combinator::TryMapFrom [] [src]

pub struct TryMapFrom<C, T, E, F> { /* fields omitted */ }

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

This is created by calling EncodeExt::try_map_from method.

Methods

impl<C, T, E, F> TryMapFrom<C, T, E, F>
[src]

Important traits for &'a mut W
[src]

Returns a reference to the inner encoder.

Important traits for &'a mut W
[src]

Returns a mutable reference to the inner encoder.

[src]

Takes ownership of this instance and returns the inner encoder.

Trait Implementations

impl<C: Debug, T: Debug, E: Debug, F: Debug> Debug for TryMapFrom<C, T, E, F>
[src]

[src]

Formats the value using the given formatter. Read more

impl<C, T, E, F> Encode for TryMapFrom<C, T, E, F> where
    C: Encode,
    F: Fn(T) -> Result<C::Item, E>,
    Error: From<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. Read more

impl<C, T, E, F> SizedEncode for TryMapFrom<C, T, E, F> where
    C: SizedEncode,
    F: Fn(T) -> Result<C::Item, E>,
    Error: From<E>, 
[src]

[src]

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

Auto Trait Implementations

impl<C, T, E, F> Send for TryMapFrom<C, T, E, F> where
    C: Send,
    E: Send,
    F: Send,
    T: Send

impl<C, T, E, F> Sync for TryMapFrom<C, T, E, F> where
    C: Sync,
    E: Sync,
    F: Sync,
    T: Sync