SequenceRuleBuilder

Struct SequenceRuleBuilder 

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

Sequence rule builder.

Implementations§

Source§

impl<D> SequenceRuleBuilder<D>

Source

pub fn new(destination: D) -> Self

Creates a sequence rule builder.

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.