Struct async_codec_util::decoder::Map
[−]
[src]
pub struct Map<D, F> { /* fields omitted */ }
Change the return type of a decoder by mapping its item through a function.
Methods
impl<D, F> Map<D, F>
[src]
Trait Implementations
impl<D, F, U> AsyncDecode for Map<D, F> where
D: AsyncDecode,
F: FnOnce(D::Item) -> U,
[src]
D: AsyncDecode,
F: FnOnce(D::Item) -> U,
type Item = U
The type of the value to decode.
type Error = D::Error
An error indicating how decoding can fail.
fn poll_decode<R: AsyncRead>(
self,
cx: &mut Context,
reader: &mut R
) -> PollDec<Self::Item, Self, Self::Error>
[src]
self,
cx: &mut Context,
reader: &mut R
) -> PollDec<Self::Item, Self, Self::Error>
Call reader.poll_read
exactly once, propgating any Err
and Pending
, and return how many bytes have been read, as well as the decoded value, once decoding is done. Read more