Trait moonlander_gp::AstNode [] [src]

pub trait AstNode: Any + Mutatable + Copyable + Sync {
    fn node_type(&self) -> usize;
    fn children(&self) -> Vec<&AstNode>;
    fn replace_child(
        &self,
        old_child: &AstNode,
        new_child: &mut Option<Box<AstNode>>
    ) -> Box<AstNode>; }

Main trait to be implemented for AST node types

Required Methods

Identify the node type, because Any::get_type_id() is unstable.

Return all children of this node.

Return a copy of this node with a single child node replaced.

Methods

impl AstNode

Trait Implementations

impl<T> Downcast<T> for AstNode where
    T: AstNode

Implementors