pub struct Rule<T> {
pub r: Regex,
pub f: Box<dyn Fn(&str, usize, usize) -> Option<T>>,
}
Expand description
Don’t create a Rule yourself, use the
rules!
macro to create Rulse for the lexer!
Internal struct that contains a Regex
and a Fn(&str, usize, usize) -> Option<T>
Fields§
§r: Regex
Regex
f: Box<dyn Fn(&str, usize, usize) -> Option<T>>
Fn(&str, usize, usize) -> Option<T>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Rule<T>
impl<T> !RefUnwindSafe for Rule<T>
impl<T> !Send for Rule<T>
impl<T> !Sync for Rule<T>
impl<T> Unpin for Rule<T>
impl<T> !UnwindSafe for Rule<T>
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