pub struct StateFunction(pub fn(&mut Tokenizer<'_>) -> Option<StateFunction>);Expand description
A recursive function type used by lexers to manage their state.
Based on Rob Pike’s “Lexical Scanning in Go” talk, these functions are
invoked in a call/return loop (letting the current function determine
the next) until a None value is returned, after which lexing is complete.
See the lexers module for examples.
Tuple Fields§
§0: fn(&mut Tokenizer<'_>) -> Option<StateFunction>Auto Trait Implementations§
impl Freeze for StateFunction
impl RefUnwindSafe for StateFunction
impl Send for StateFunction
impl Sync for StateFunction
impl Unpin for StateFunction
impl UnwindSafe for StateFunction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more