Struct cfg::rule::builder::RuleBuilder
source · pub struct RuleBuilder<C>where
C: RuleContainer,{ /* private fields */ }
Expand description
The rule builder.
Implementations§
source§impl<C> RuleBuilder<C>where
C: RuleContainer,
impl<C> RuleBuilder<C>where C: RuleContainer,
sourcepub fn new(rules: C) -> RuleBuilder<C>
pub fn new(rules: C) -> RuleBuilder<C>
Creates a rule builder.
source§impl<C> RuleBuilder<C>where
C: RuleContainer,
impl<C> RuleBuilder<C>where C: RuleContainer,
sourcepub fn history(self, history: HistoryId) -> Self
pub fn history(self, history: HistoryId) -> Self
Assigns the rule history, which is used on the next call to rhs
, or overwritten by a call
to rhs_with_history
.
sourcepub fn rhs<S>(self, syms: S) -> Selfwhere
S: AsRef<[Symbol]>,
pub fn rhs<S>(self, syms: S) -> Selfwhere S: AsRef<[Symbol]>,
Adds a rule alternative to the grammar. If history wasn’t provided, the rule has the
Default
history.
sourcepub fn rhs_with_history<Sr>(self, syms: Sr, history_id: HistoryId) -> Selfwhere
Sr: AsRef<[Symbol]>,
pub fn rhs_with_history<Sr>(self, syms: Sr, history_id: HistoryId) -> Selfwhere Sr: AsRef<[Symbol]>,
Adds a rule alternative with the given RHS and history to the grammar.
sourcepub fn rhs_with_linked_history<Sr>(
self,
syms: Sr,
linked_history: LinkedHistoryNode
) -> Selfwhere
Sr: AsRef<[Symbol]>,
pub fn rhs_with_linked_history<Sr>( self, syms: Sr, linked_history: LinkedHistoryNode ) -> Selfwhere Sr: AsRef<[Symbol]>,
Adds a rule alternative with the given RHS and history to the grammar.
sourcepub fn precedenced_rule(self, lhs: Symbol) -> PrecedencedRuleBuilder<C>
pub fn precedenced_rule(self, lhs: Symbol) -> PrecedencedRuleBuilder<C>
Starts building a new precedenced rule.
Auto Trait Implementations§
impl<C> RefUnwindSafe for RuleBuilder<C>where C: RefUnwindSafe,
impl<C> Send for RuleBuilder<C>where C: Send,
impl<C> Sync for RuleBuilder<C>where C: Sync,
impl<C> Unpin for RuleBuilder<C>where C: Unpin,
impl<C> UnwindSafe for RuleBuilder<C>where C: UnwindSafe,
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