pub enum Peg {
Control(Control),
Rule(Rule),
}Expand description
An element of a PEG grammar stack.
Variants§
Control(Control)
A control element. Should not appear on the stack by the end of parsing.
Rule(Rule)
A grammar rule element.
Implementations§
Source§impl Peg
impl Peg
pub fn sequence_start(span: Span) -> Self
pub fn group_start(delimiter: GroupDelimiter, span: Span) -> Self
pub fn try_as_rule(self) -> Result<Rule>
pub fn try_as_mut_rule(&mut self) -> Result<&mut Rule>
pub fn span(&self) -> Span
Trait Implementations§
Source§impl Ord for Peg
impl Ord for Peg
Source§impl PartialOrd for Peg
impl PartialOrd for Peg
impl Eq for Peg
impl StructuralPartialEq for Peg
Auto Trait Implementations§
impl Freeze for Peg
impl RefUnwindSafe for Peg
impl Send for Peg
impl Sync for Peg
impl Unpin for Peg
impl UnsafeUnpin for Peg
impl UnwindSafe for Peg
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