Node

Trait Node 

Source
pub trait Node: Clone {
    type State;

    // Required method
    fn next<F>(self, rt: &mut Runtime<'_, Self, F>) -> Control<Self>
       where F: Frontend;
}
Expand description

A story node in a narrative.

In a branching narrative, a node is a place where the story can split into different branches.

While Nodes themselves should be transient and not hold too much data, they have an associated state that can be mutated.

Required Associated Types§

Source

type State

The state that the node transforms

Required Methods§

Source

fn next<F>(self, rt: &mut Runtime<'_, Self, F>) -> Control<Self>
where F: Frontend,

Handle the node to transforms the state and determine the next node

The state can be access by derefing the Runtime.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§