Enum yarpl::Done[][src]

pub enum Done {
    Terminal {
        name: &'static str,
        matched_string: String,
    },
    Nonterminal {
        name: &'static str,
        children: Vec<Rc<Self>>,
    },
    Empty(),
}

Concrete syntax tree formed from a parsing function.

Variants

Terminal

A leaf node - holds the match from the original string as well as it's name.

Fields of Terminal

name: &'static strmatched_string: String
Nonterminal

A nonterminal node that has a name and branches.

Fields of Nonterminal

name: &'static strchildren: Vec<Rc<Self>>
Empty()

An empty node - holds nothing.

Implementations

impl Done[src]

pub fn name(&self) -> Option<&'static str>[src]

Returns this name.

pub fn children(&self) -> Option<Vec<Rc<Done>>>[src]

Returns children of this Done if it has any.

pub fn matched_string(&self) -> Option<String>[src]

Returns the matched string of this Done if it has one.

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

Returns whether this is a terminal node.

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

Returns whether this is a nonterminal node.

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

Returns whether this is an empty node.

pub fn rename(&mut self, new_name: &'static str)[src]

Trait Implementations

impl Clone for Done[src]

impl Debug for Done[src]

impl Display for Done[src]

Auto Trait Implementations

impl !RefUnwindSafe for Done[src]

impl !Send for Done[src]

impl !Sync for Done[src]

impl Unpin for Done[src]

impl !UnwindSafe for Done[src]

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> ToString for T where
    T: Display + ?Sized
[src]

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.