pub struct SequenceRuleBuilder<D: SequenceDestination> { /* private fields */ }
Expand description
Sequence rule builder.
Implementations§
Source§impl<D> SequenceRuleBuilder<D>where
D: SequenceDestination,
impl<D> SequenceRuleBuilder<D>where
D: SequenceDestination,
Sourcepub fn separator(self, sep: Separator) -> Self
pub fn separator(self, sep: Separator) -> Self
Assigns the separator symbol and mode of separation.
Sourcepub fn intersperse(self, sym: Symbol) -> Self
pub fn intersperse(self, sym: Symbol) -> Self
Sets proper separation with the given separator symbol.
Sourcepub fn history(self, history: History) -> Self
pub fn history(self, history: History) -> 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 inclusive(self, start: u32, end: Option<u32>) -> Self
pub fn inclusive(self, start: u32, end: Option<u32>) -> Self
Assigns the inclusive range of the number of repetitions.
Sourcepub fn range(self, range: impl RangeBounds<u32>) -> Self
pub fn range(self, range: impl RangeBounds<u32>) -> Self
Adds a range to the sequence.
Sourcepub fn rhs_with_range(self, rhs: Symbol, range: impl RangeBounds<u32>) -> Self
pub fn rhs_with_range(self, rhs: Symbol, range: impl RangeBounds<u32>) -> Self
Adds a sequence rule to the grammar.
Sourcepub fn rhs_with_history(self, rhs: Symbol, history: Option<History>) -> Self
pub fn rhs_with_history(self, rhs: Symbol, history: Option<History>) -> Self
Adds a sequence rule to the grammar.
Auto Trait Implementations§
impl<D> Freeze for SequenceRuleBuilder<D>where
D: Freeze,
impl<D> RefUnwindSafe for SequenceRuleBuilder<D>where
D: RefUnwindSafe,
impl<D> Send for SequenceRuleBuilder<D>where
D: Send,
impl<D> Sync for SequenceRuleBuilder<D>where
D: Sync,
impl<D> Unpin for SequenceRuleBuilder<D>where
D: Unpin,
impl<D> UnwindSafe for SequenceRuleBuilder<D>where
D: 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