Struct async_codec_util::decoder::Chain
[−]
[src]
pub struct Chain<S, T>(_)
where
S: AsyncDecode;
Chain two decoders, running them in sequence.
Methods
impl<S, T> Chain<S, T> where
S: AsyncDecode,
[src]
S: AsyncDecode,
pub fn new(first: S, second: T) -> Chain<S, T>
[src]
Create new Chain
which first decodes via the given S
and then decodes via the given T
.
Trait Implementations
impl<S, T> AsyncDecode for Chain<S, T> where
S: AsyncDecode,
T: AsyncDecode<Error = S::Error>,
[src]
S: AsyncDecode,
T: AsyncDecode<Error = S::Error>,
type Item = (S::Item, T::Item)
The type of the value to decode.
type Error = S::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