pub enum ParseTreeType<'t> {
    T(Token<'t>),
    N(&'static str),
}
Expand description

The type of the elements in the parse tree.

The lifetime parameter 't refers to the lifetime of the scanned text.

Variants

T(Token<'t>)

A scanned token.

N(&'static str)

A non-terminal name. All names are of static lifetime (see NON_TERMINALS slice of non-terminal names).

Implementations

Tries to access the Token of the ParseTreeType. Can fail if the entry is no terminal (i.e. a non-terminal).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Implementation of the Visualize trait to support the visualization of the ParseTreeType in a tree layout.

Returns the string representation of the nodes data.

When this method returns true the drawer can emphasize the node’s string representation in an implementation dependent way, i.e. it can print it bold. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.