pub struct Sequence {
pub lhs: Symbol,
pub rhs: Symbol,
pub start: u32,
pub end: Option<u32>,
pub separator: Separator,
pub history_id: Option<HistoryId>,
}
Expand description
Sequence rule representation.
Fields§
§lhs: Symbol
The rule’s left-hand side.
rhs: Symbol
The rule’s right-hand side.
start: u32
The minimum number of repetitions.
end: Option<u32>
Either the inclusive maximum number of repetitions, or None
if the number of repetitions
is unlimited.
separator: Separator
The way elements are separated in a sequence, or Null
.
history_id: Option<HistoryId>
The history carried with the sequence rule.
Implementations§
source§impl Sequence
impl Sequence
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 separator(self, sep: Separator) -> Self
pub fn separator(self, sep: Separator) -> Self
Assigns the separator symbol and mode of separation.
sourcepub fn range(self, range: impl RangeBounds<u32>) -> Self
pub fn range(self, range: impl RangeBounds<u32>) -> Self
Adds a range to the sequence.
Trait Implementations§
source§impl PartialEq for Sequence
impl PartialEq for Sequence
impl Copy for Sequence
impl Eq for Sequence
impl StructuralEq for Sequence
impl StructuralPartialEq for Sequence
Auto Trait Implementations§
impl RefUnwindSafe for Sequence
impl Send for Sequence
impl Sync for Sequence
impl Unpin for Sequence
impl UnwindSafe for Sequence
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