Struct async_codec_util::decoder::Map
[−]
[src]
pub struct Map<R, D, F> { /* fields omitted */ }
Change the return type of a decoder by mapping its item through a function.
Methods
impl<R, D, F> Map<R, D, F>
[src]
Trait Implementations
impl<R, D, F, U> AsyncDecode<R> for Map<R, D, F> where
R: AsyncRead,
D: AsyncDecode<R>,
F: FnOnce(D::Item) -> U,
[src]
R: AsyncRead,
D: AsyncDecode<R>,
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(
&mut self,
cx: &mut Context,
reader: &mut R
) -> Poll<(Option<Self::Item>, usize), DecodeError<Self::Error>>
[src]
&mut self,
cx: &mut Context,
reader: &mut R
) -> Poll<(Option<Self::Item>, usize), DecodeError<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