pub struct Node<'a, T> {
    pub id: NodeId,
    pub span: Span,
    pub parent: Cell<Option<&'a dyn AnyNode<'a>>>,
    pub order: Cell<usize>,
    pub data: T,
}
Expand description

Common denominator across all AST nodes.

Fields

id: NodeId

Unique ID assigned to the node.

span: Span

Full span the node covers in the input.

parent: Cell<Option<&'a dyn AnyNode<'a>>>

Parent node.

order: Cell<usize>

Lexical order of the node.

data: T

Per-node data.

Implementations

Create a new AST node.

Check if this is an implicit type.

Check if this is an implicit type.

Get the parent instantiation.

Trait Implementations

Walk a visitor over the contents of self.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Allocate a value of type T.

Automatically implement AnyNode for Node<T> if enough information is present.

Get this node’s unique ID.

Get this node’s span in the input.

Get this node’s lexical order.

Get this node’s parent.

Link up this node.

Link up this node as an expansion of another node. Read more

Get a span that is terse and suitable to pinpoint the node for a human.

Convert this node reference to a pointer for identity comparisons.

Automatically implement AnyNodeData for Node<T> if the inner node implements it.

Get this node’s name, or None if it does not have one.

Describe this node for diagnostics in indefinite form, e.g. “entity”. Read more

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”. Read more

Describe this node for diagnostics in indefinite form, e.g. “entity”.

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”. Read more

Describe this node for diagnostics in indefinite form, e.g. “entity”.

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Allow any node to be debug-formatted.

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Allow any node to be printed in diagnostics in a human-friendly form.

Formats the value using the given formatter. Read more

Apply a function to each child node.

Apply a function to this node.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.