pub struct GrammarBuilder { /* private fields */ }Expand description
Fluent builder for order-preserving grammars.
Implementations§
Source§impl GrammarBuilder
impl GrammarBuilder
Sourcepub const fn source_format(self, source_format: GrammarFormat) -> Self
pub const fn source_format(self, source_format: GrammarFormat) -> Self
Returns this builder with a source format.
Sourcepub fn start(self, start: impl Into<String>) -> Self
pub fn start(self, start: impl Into<String>) -> Self
Returns this builder with a start rule name.
Sourcepub fn rule(self, name: impl Into<String>, expr: GrammarExpr) -> Self
pub fn rule(self, name: impl Into<String>, expr: GrammarExpr) -> Self
Adds a normal rule from a name and expression.
Sourcepub fn grammar_rule(self, rule: GrammarRule) -> Self
pub fn grammar_rule(self, rule: GrammarRule) -> Self
Adds a complete rule.
Sourcepub fn rule_with_kind(
self,
name: impl Into<String>,
expr: GrammarExpr,
kind: RuleKind,
) -> Self
pub fn rule_with_kind( self, name: impl Into<String>, expr: GrammarExpr, kind: RuleKind, ) -> Self
Adds a rule with an explicit kind.
Trait Implementations§
Source§impl Clone for GrammarBuilder
impl Clone for GrammarBuilder
Source§fn clone(&self) -> GrammarBuilder
fn clone(&self) -> GrammarBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GrammarBuilder
impl Debug for GrammarBuilder
Source§impl Default for GrammarBuilder
impl Default for GrammarBuilder
Source§fn default() -> GrammarBuilder
fn default() -> GrammarBuilder
Returns the “default value” for a type. Read more
Source§impl PartialEq for GrammarBuilder
impl PartialEq for GrammarBuilder
Source§fn eq(&self, other: &GrammarBuilder) -> bool
fn eq(&self, other: &GrammarBuilder) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for GrammarBuilder
impl StructuralPartialEq for GrammarBuilder
Auto Trait Implementations§
impl Freeze for GrammarBuilder
impl RefUnwindSafe for GrammarBuilder
impl Send for GrammarBuilder
impl Sync for GrammarBuilder
impl Unpin for GrammarBuilder
impl UnsafeUnpin for GrammarBuilder
impl UnwindSafe for GrammarBuilder
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.