Function nom::combinator::rest_len

source ·
pub fn rest_len<T, E: ParseError<T>>(input: T) -> IResult<T, usize, E>where
    T: InputLength,
Expand description

Return the length of the remaining input.

use nom::combinator::rest_len;
assert_eq!(rest_len::<_,(_, ErrorKind)>("abc"), Ok(("abc", 3)));
assert_eq!(rest_len::<_,(_, ErrorKind)>(""), Ok(("", 0)));