Function winnow::combinator::rest_len

source ·
pub fn rest_len<I, E: ParserError<I>>(input: &mut I) -> PResult<usize, E>
where I: Stream,
Expand description

Return the length of the remaining input.

Note: this does not advance the Stream

§Example

use winnow::combinator::rest_len;
assert_eq!(rest_len::<_,InputError<_>>.parse_peek("abc"), Ok(("abc", 3)));
assert_eq!(rest_len::<_,InputError<_>>.parse_peek(""), Ok(("", 0)));