[−][src]Struct cfg::rule::builder::RuleBuilder
The rule builder.
Methods
impl<C> RuleBuilder<C> where
C: RuleContainer,
[src]
C: RuleContainer,
pub fn new(rules: C) -> RuleBuilder<C>
[src]
Creates a rule builder.
impl<C, Hs> RuleBuilder<C, Hs> where
C: RuleContainer,
[src]
C: RuleContainer,
pub fn default_history<Hs2>(self, state: Hs2) -> RuleBuilder<C, Hs2>
[src]
Sets the default history source.
pub fn rule(self, lhs: Symbol) -> Self
[src]
Starts building a new rule with the given LHS.
pub fn history(self, history: C::History) -> Self
[src]
Assigns the rule history, which is used on the next call to rhs
, or overwritten by a call
torhs_with_history
.
pub fn rhs<Sr>(self, syms: Sr) -> Self where
Sr: AsRef<[Symbol]>,
Hs: HistorySource<C::History>,
[src]
Sr: AsRef<[Symbol]>,
Hs: HistorySource<C::History>,
Adds a rule alternative to the grammar. If history wasn't provided, the rule has the
Default
history.
pub fn rhs_with_history<Sr>(self, syms: Sr, history: C::History) -> Self where
Sr: AsRef<[Symbol]>,
[src]
Sr: AsRef<[Symbol]>,
Adds a rule alternative with the given RHS and history to the grammar.
pub fn precedenced_rule(self, lhs: Symbol) -> PrecedencedRuleBuilder<C> where
C::History: AssignPrecedence + Default,
[src]
C::History: AssignPrecedence + Default,
Starts building a new precedenced rule.
Auto Trait Implementations
impl<C, Hs> Send for RuleBuilder<C, Hs> where
C: Send,
Hs: Send,
<C as RuleContainer>::History: Send,
C: Send,
Hs: Send,
<C as RuleContainer>::History: Send,
impl<C, Hs> Sync for RuleBuilder<C, Hs> where
C: Sync,
Hs: Sync,
<C as RuleContainer>::History: Sync,
C: Sync,
Hs: Sync,
<C as RuleContainer>::History: Sync,
impl<C, Hs> Unpin for RuleBuilder<C, Hs> where
C: Unpin,
Hs: Unpin,
<C as RuleContainer>::History: Unpin,
C: Unpin,
Hs: Unpin,
<C as RuleContainer>::History: Unpin,
impl<C, Hs> UnwindSafe for RuleBuilder<C, Hs> where
C: UnwindSafe,
Hs: UnwindSafe,
<C as RuleContainer>::History: UnwindSafe,
C: UnwindSafe,
Hs: UnwindSafe,
<C as RuleContainer>::History: UnwindSafe,
impl<C, Hs> RefUnwindSafe for RuleBuilder<C, Hs> where
C: RefUnwindSafe,
Hs: RefUnwindSafe,
<C as RuleContainer>::History: RefUnwindSafe,
C: RefUnwindSafe,
Hs: RefUnwindSafe,
<C as RuleContainer>::History: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,