Function pest::state
[−]
[src]
pub fn state<'i, R: RuleType, F>(
input: &'i str,
f: F
) -> Result<Pairs<'i, R>, Error<'i, R>> where
F: FnOnce(&mut ParserState<'i, R>, Position<'i>) -> Result<Position<'i>, Position<'i>>,
Creates a ParserState
from a &str
, supplying it to a closure f
.
Examples
let input = ""; pest::state::<(), _>(input, |_, pos| { Ok(pos) }).unwrap();