[][src]Function combine::parser::error::unexpected_any

pub fn unexpected_any<I, S, T>(message: S) -> Unexpected<I, T> where
    I: Stream,
    S: Into<Info<I::Item, I::Range>>, 

Always fails with message as an unexpected error. Never consumes any input.

May have anything as the output type but must be used such that the output type can inferred. The unexpected parser can be used if the output type does not matter

let result = token('b').or(unexpected_any("token"))
    .easy_parse("a");
assert!(result.is_err());
assert!(
    result.err()
        .unwrap()
        .errors
        .iter()
        .any(|m| *m == StreamError::unexpected("token".into()))
);