[][src]Enum branchy::Symbol

pub enum Symbol<Nt, T> {
    Nonterminal(Nt),
    Terminal(T),
}

Used to describe non-terminal and terminal symbols in Rules and grammar input sequences for Expander::expand().

Variants

Nonterminal(Nt)

Variant for non-terminal symbols - ones which can be further expanded, can appear on left-hand side of rules and cannot appear in a successful expansion result.

Terminal(T)

Variant for terminal symbols - ones which will not be replaced during expansion, cannot appear on left-hand side of rules and will be the only ones in a successful expansion result.

Methods

impl<Nt, T> Symbol<Nt, T>[src]

pub fn is_terminal(&self) -> bool[src]

pub fn is_nonterminal(&self) -> bool[src]

pub fn unwrap_nonterm(self) -> Nt[src]

pub fn expect_nonterm(self, message: &'static str) -> Nt[src]

pub fn unwrap_term(self) -> T[src]

pub fn expect_term(self, message: &'static str) -> T[src]

Trait Implementations

impl<Nt: Clone, T: Clone> Clone for Symbol<Nt, T>[src]

impl<Nt: Copy, T: Copy> Copy for Symbol<Nt, T>[src]

impl<Nt: Debug, T: Debug> Debug for Symbol<Nt, T>[src]

impl<Nt: PartialEq, T: PartialEq> PartialEq<Symbol<Nt, T>> for Symbol<Nt, T>[src]

impl<Nt, T> StructuralPartialEq for Symbol<Nt, T>[src]

Auto Trait Implementations

impl<Nt, T> RefUnwindSafe for Symbol<Nt, T> where
    Nt: RefUnwindSafe,
    T: RefUnwindSafe

impl<Nt, T> Send for Symbol<Nt, T> where
    Nt: Send,
    T: Send

impl<Nt, T> Sync for Symbol<Nt, T> where
    Nt: Sync,
    T: Sync

impl<Nt, T> Unpin for Symbol<Nt, T> where
    Nt: Unpin,
    T: Unpin

impl<Nt, T> UnwindSafe for Symbol<Nt, T> where
    Nt: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,