[−][src]Function combine::unexpected
pub fn unexpected<I, S>(message: S) -> Unexpected<I, ()> where
I: Stream,
S: Into<Info<I::Item, I::Range>>, Always fails with message as an unexpected error.
Never consumes any input.
Has () the output type
let result = unexpected("token") .easy_parse("a"); assert!(result.is_err()); assert!( result.err() .unwrap() .errors .iter() .any(|m| *m == StreamError::unexpected("token".into())) );