Node

Enum Node 

Source
pub enum Node<'source> {
Show 34 variants Unit(Token<'source>, Token<'source>), Bool(bool, Token<'source>), Number(Token<'source>), String(Token<'source>), Variable(Token<'source>), Block(Box<Block<'source>>), If(Box<If<'source>>), Match(Box<Match<'source>>), Enum(Box<Enum<'source>>), Pipe(Token<'source>), Call(Token<'source>), Bind(Token<'source>), Positive(Token<'source>), Negative(Token<'source>), Annotation(Box<Annotation<'source>>), Deref(Token<'source>), Mul(Token<'source>), Div(Token<'source>), Add(Token<'source>), Sub(Token<'source>), BitwiseAnd(Token<'source>), BitwiseOr(Token<'source>), BitwiseXor(Token<'source>), EqualTo(Token<'source>), NotEqualTo(Token<'source>), Greater(Token<'source>), GreaterEqual(Token<'source>), Lesser(Token<'source>), LesserEqual(Token<'source>), LogicalAnd(Token<'source>), LogicalOr(Token<'source>), Name { name: Token<'source>, colon_token: Token<'source>, }, Field { dot_token: Token<'source>, index: Token<'source>, }, Tuple(Token<'source>),
}
Expand description

Components of an expression.

Expression evalutation is stack-based rather than using a syntax tree.

Variants§

§

Unit(Token<'source>, Token<'source>)

§

Bool(bool, Token<'source>)

§

Number(Token<'source>)

§

String(Token<'source>)

§

Variable(Token<'source>)

§

Block(Box<Block<'source>>)

§

If(Box<If<'source>>)

§

Match(Box<Match<'source>>)

§

Enum(Box<Enum<'source>>)

§

Pipe(Token<'source>)

§

Call(Token<'source>)

§

Bind(Token<'source>)

§

Positive(Token<'source>)

§

Negative(Token<'source>)

§

Annotation(Box<Annotation<'source>>)

§

Deref(Token<'source>)

§

Mul(Token<'source>)

§

Div(Token<'source>)

§

Add(Token<'source>)

§

Sub(Token<'source>)

§

BitwiseAnd(Token<'source>)

§

BitwiseOr(Token<'source>)

§

BitwiseXor(Token<'source>)

§

EqualTo(Token<'source>)

§

NotEqualTo(Token<'source>)

§

Greater(Token<'source>)

§

GreaterEqual(Token<'source>)

§

Lesser(Token<'source>)

§

LesserEqual(Token<'source>)

§

LogicalAnd(Token<'source>)

§

LogicalOr(Token<'source>)

§

Name

Fields

§name: Token<'source>
§colon_token: Token<'source>
§

Field

Fields

§dot_token: Token<'source>
§index: Token<'source>
§

Tuple(Token<'source>)

Trait Implementations§

Source§

impl<'source> Debug for Node<'source>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'source> From<Box<Match<'source>>> for Node<'source>

Source§

fn from(struct_block: Box<Match<'source>>) -> Self

Converts to this type from the input type.
Source§

impl<'source> From<Enum<'source>> for Node<'source>

Source§

fn from(struct_block: Enum<'source>) -> Self

Converts to this type from the input type.
Source§

impl<'source> From<If<'source>> for Node<'source>

Source§

fn from(if_block: If<'source>) -> Self

Converts to this type from the input type.
Source§

impl<'source> PartialEq for Node<'source>

Source§

fn eq(&self, other: &Node<'source>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'source> Eq for Node<'source>

Source§

impl<'source> StructuralPartialEq for Node<'source>

Auto Trait Implementations§

§

impl<'source> Freeze for Node<'source>

§

impl<'source> RefUnwindSafe for Node<'source>

§

impl<'source> Send for Node<'source>

§

impl<'source> Sync for Node<'source>

§

impl<'source> Unpin for Node<'source>

§

impl<'source> UnwindSafe for Node<'source>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.