[][src]Struct cfg::rule::builder::RuleBuilder

pub struct RuleBuilder<C, Hs = NullHistorySource> where
    C: RuleContainer
{ /* fields omitted */ }

The rule builder.

Methods

impl<C> RuleBuilder<C> where
    C: RuleContainer
[src]

pub fn new(rules: C) -> RuleBuilder<C>[src]

Creates a rule builder.

impl<C, Hs> RuleBuilder<C, Hs> where
    C: RuleContainer
[src]

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]

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]

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]

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

impl<C, Hs> Sync for RuleBuilder<C, Hs> where
    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

impl<C, Hs> UnwindSafe for RuleBuilder<C, Hs> where
    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

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]