pub fn decode<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.

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.

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