Function winnow::combinator::eof

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

Match the end of the Stream

Otherwise, it will error.

§Example


let mut parser = eof;
assert_eq!(parser.parse_peek("abc"), Err(ErrMode::Backtrack(InputError::new("abc", ErrorKind::Eof))));
assert_eq!(parser.parse_peek(""), Ok(("", "")));