pub struct SequenceRuleBuilder<D> { /* private fields */ }
Expand description

Sequence rule builder.

Implementations§

source§

impl<D> SequenceRuleBuilder<D>where D: SequenceDestination,

source

pub fn new(destination: D) -> Self

Creates a sequence rule builder.

source

pub fn default_history( self, default_history: HistoryId ) -> SequenceRuleBuilder<D>

Sets the default history source.

source

pub fn sequence(self, lhs: Symbol) -> Self

Starts building a sequence rule.

source

pub fn separator(self, sep: Separator) -> Self

Assigns the separator symbol and mode of separation.

source

pub fn intersperse(self, sym: Symbol) -> Self

Sets proper separation with the given separator symbol.

source

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.

source

pub fn inclusive(self, start: u32, end: Option<u32>) -> Self

Assigns the inclusive range of the number of repetitions.

source

pub fn rhs(self, rhs: Symbol) -> Self

Adds a sequence rule to the grammar.

source

pub fn range(self, range: impl RangeBounds<u32>) -> Self

Adds a range to the sequence.

source

pub fn rhs_with_range(self, rhs: Symbol, range: impl RangeBounds<u32>) -> Self

Adds a sequence rule to the grammar.

source

pub fn rhs_with_history( self, rhs: Symbol, history_id: Option<HistoryId> ) -> Self

Adds a sequence rule to the grammar.

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.