Struct async_codec_util::decoder::AndThen
[−]
[src]
pub struct AndThen<S, T, F>(_);
Run a decoder and use the produced item to construct the next decoder to run.
Methods
impl<S, T, F> AndThen<S, T, F>
[src]
pub fn new(first: S, f: F) -> AndThen<S, T, F>
[src]
Run a decoder and use the produced item to construct the next decoder to run.
Trait Implementations
impl<S, T, F> AsyncDecode for AndThen<S, T, F> where
S: AsyncDecode,
T: AsyncDecode<Error = S::Error>,
F: FnOnce(S::Item) -> T,
[src]
S: AsyncDecode,
T: AsyncDecode<Error = S::Error>,
F: FnOnce(S::Item) -> T,
type Item = T::Item
The type of the value to decode.
type Error = T::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