pub struct Rule(/* private fields */);Expand description
A grammar rule.
Implementations§
Source§impl Rule
impl Rule
pub fn sequence(rules: Vec<Rule>, span: Span) -> Self
pub fn choice(rules: Vec<Rule>, span: Span) -> Self
pub fn group(delimiter: GroupDelimiter, rule: Rule, span: Span) -> Self
pub fn repeat( element: Rule, separator: Rule, at_least: AtLeast, span: Span, ) -> Self
pub fn optional(rule: Rule, span: Span) -> Self
pub fn punctuation(repr: String, span: Span) -> Self
pub fn keyword(repr: String, span: Span) -> Self
pub fn other(repr: String, span: Span) -> Self
pub fn builtin(repr: String, span: Span) -> Self
pub fn peg(self) -> Peg
Trait Implementations§
Source§impl Ord for Rule
impl Ord for Rule
Source§impl PartialOrd for Rule
impl PartialOrd for Rule
impl Eq for Rule
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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