Function combine::stream::decode_tokio[][src]

pub fn decode_tokio<Input, P>(
    parser: P,
    input: &mut Input,
    partial_state: &mut P::PartialState
) -> Result<(Option<P::Output>, usize), <Input as StreamOnce>::Error> where
    P: Parser<Input>,
    Input: RangeStream
Expand description

Decodes input using parser. Like decode but works directly in both tokio_util::Decoder::decode and tokio_util::Decoder::decode_eof

Return Ok(Some(token), committed_data) if there was enough data to finish parsing using parser. Returns Ok(None, committed_data) if input did not contain enough data to finish parsing using parser. Returns Ok(None, 0) if input did not contain enough data to finish parsing using parser.

See examples/async.rs for example usage in a tokio_io::codec::Decoder