pest

Function state

Source
pub fn state<'i, R: RuleType, F>(
    input: &'i str,
    f: F,
) -> Result<Pairs<'i, R>, Error<R>>
where F: FnOnce(Box<ParserState<'i, R>>) -> ParseResult<Box<ParserState<'i, R>>>,
Expand description

Creates a ParserState from a &str, supplying it to a closure f.

ยงExamples

let input = "";
pest::state::<(), _>(input, |s| Ok(s)).unwrap();