winnow::token

Function rest

Source
pub fn rest<Input, Error>(
    input: &mut Input,
) -> Result<<Input as Stream>::Slice, Error>
where Input: Stream, Error: ParserError<Input>,
Expand description

Return the remaining input.

§Effective Signature

Assuming you are parsing a &str Stream:

pub fn rest<'i>(input: &mut &'i str) -> ModalResult<&'i str>

§Example

use winnow::token::rest;
assert_eq!(rest::<_,ContextError>.parse_peek("abc"), Ok(("", "abc")));
assert_eq!(rest::<_,ContextError>.parse_peek(""), Ok(("", "")));