Function glue::combinators::finders::find_any

source ยท
pub fn find_any<'a, Res, Par>(parser: Par) -> impl Parser<'a, Res>
where Par: BranchParser<'a, Res>,
Expand description

Run each of the provided parsers until one is successful and return its result.

assert_eq!(
    find_any((is("foo"), is("bar"))).parse("foobar"),
    Ok((
        ParserContext {
            input: "foobar",
            bounds: 0..3,
        },
        "foo",
    ))
);

Each parser that is passed to find_any must return the same type as the parser only has a single output type.