Trait aspen::node::Internals [] [src]

pub trait Internals {
    fn tick(&mut self) -> Status;
    fn reset(&mut self);
    fn type_name(&self) -> &'static str;

    fn children(&self) -> Option<Vec<&Node>> { ... }
}

The internal logic of a node.

This is the object that controls the tick behavior of the Node, with Node just being a wrapper to enforce some runtime behavior.

Required Methods

Ticks the internal state of the node a single time.

Node internals should not automatically reset themselves. If a node has been run to completion, the Node that holds this object will call reset before ticking the node.

In other words, the Internals will only ever be ticked when the node state is either Status::Running or Status::Initialized.

Resets the internal state of the node.

This sets the node to a state that is identical to a newly constructed node. Note that this could be called when the node is in any state.

Returns the type of the node as a string literal.

In general, this should be the name of the node type. However, there are plans to add a "name" property to the Node struct, at which point this function will be depricated.

Provided Methods

Returns a vector of references to this node's children.

Default behavior is to return None, which should be suitable for any leaf node.

Implementors