pub struct Rule {
pub rules: Arc<RwLock<HashMap<String, Box<dyn Generator>>>>,
pub name: String,
}Expand description
Rule is a Generator for invoking a named rule Generator. This is useful for implementing recursion and avoiding duplication of portions of a grammar.
Only names that have already been registered should be used. If a corresponding rule does not exist when generate is called it will panic.
Fields§
§rules: Arc<RwLock<HashMap<String, Box<dyn Generator>>>>§name: StringTrait Implementations§
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl !Send for Rule
impl !Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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