Function parser_combinators::unexpected [] [src]

pub fn unexpected<I, S>(message: S) -> Unexpected<I> where I: Stream, S: Into<Cow<'static, str>>

Always fails with message as the error. Never consumes any input.

 let result = unexpected("token")
     .parse("a");
 assert!(result.is_err());
 assert_eq!(result.err().unwrap().errors[0], Error::Message("token".into()));