Crate node_tree

source ·
Expand description

The root file of the library. Contains the prelude module which you will probably want to import from.

A simple node implementation will look like the following:

#![feature(arbitrary_self_types)]   // Required for now.
use node_tree::prelude::*;


#[derive(Debug, Clone, NodeSys)]
pub struct NodeA {
    base: Rc<NodeBase>   // Required for Nodes.
}
 
// To make things simple, it is advised to have most node constructors return the node
// instance wrapped inside of this crate's `Hp<T>` pointer.
impl NodeA {
    fn new(name: String) -> Hp<Self> {
        Hp::new(NodeA { base: NodeBase::new(name) })
    }
}

impl Node for NodeA {
    // feel free to implement `ready()`, `process()`, `terminal()` and/or `process_mode()`
    // here.
}

Modules§

  • Contains everything you’ll need to create and handle Nodes and NodeTrees. You’ll probably want to import all from this module.