Function glue::combinators::takers::take_until

source ยท
pub fn take_until<'a, Skip, Res, Pred, Par>(
    predicate: Pred,
    callback: Par,
) -> impl Parser<'a, &'a str>
where Pred: Parser<'a, Skip>, Par: Parser<'a, Res>,
Expand description

Run a parser until a predicate is reached and capture the input it parsed.

assert_eq!(
    take_until(eoi(), is(digit)).parse("123"),
    Ok((
        ParserContext {
            input: "123",
            bounds: 0..3,
        },
        "123"
    ))
);