pub trait AnyNode<'a>: BasicNode<'a> + AnyNodeData + Display + Send + Sync {
    fn id(&self) -> NodeId;
fn span(&self) -> Span;
fn order(&self) -> usize; fn human_span(&self) -> Span { ... }
fn get_parent(&self) -> Option<&'a dyn AnyNode<'a>> { ... }
fn link(&'a self, parent: Option<&'a dyn AnyNode<'a>>, order: &mut usize) { ... }
fn link_attach(&'a self, parent: &'a dyn AnyNode<'a>, order: usize) { ... }
fn as_ptr(&self) -> *const u8 { ... } }
Expand description

An AST node.

Required methods

Get this node’s unique ID.

Get this node’s span in the input.

Get this node’s lexical order.

Provided methods

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

Get this node’s parent.

Link up this node.

Link up this node as an expansion of another node.

All subnodes inherit the order from their parent. Useful if a node is generated as part of a later expansion/analysis pass, but needs to hook into the AST somewhere.

Convert this node reference to a pointer for identity comparisons.

Trait Implementations

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 !=.

Implementors

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