Function combine::unexpected [] [src]

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.

let result = unexpected("token")
    .parse("a");
assert!(result.is_err());
assert!(result.err().unwrap().errors.iter().any(|m| *m == Error::Unexpected("token".into())));