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