Type Alias AstNode
pub type AstNode<'a> = Node<'a, RefCell<Ast>>;
The type of a node within the document.
It is bound by the lifetime 'a, which corresponds to the Arena nodes are
allocated in. Child Asts are wrapped in RefCell for interior mutability.
You can construct a new AstNode from a NodeValue using the From trait:
# use ;
let root = from;
Note that no sourcepos information is given to the created node. If you wish
to assign sourcepos information, use the From trait to create an AstNode
from an Ast:
# use ;
let root = from;
For practical use, you'll probably need it allocated in an Arena, in which
case you can use .into() to simplify creation:
# use ;
# let arena = new;
let node_in_arena = arena.alloc;