Function yggdrasil_rt::state
source · pub fn state<'i, R, F>(
input: &'i str,
f: F
) -> Result<TokenTree<'i, R>, YggdrasilError<R>>
Expand description
Creates a ParserState
from a &str
, supplying it to a closure f
.
§Examples
let input = "";
state::<(), _>(input, |s| Ok(s)).unwrap();