pub struct Node<S: Stage> {
pub stage: S,
pub state: S::State,
pub inputs: S::Input,
pub outputs: S::Output,
pub cache: HashMap<u64, Vec<Cached<S>>>,
pub input_changed: bool,
}Expand description
Every node wraps a Stage, which is a decorated function that has some number of inputs and some number of outputs.
TODO: Explain the caching functionality in detail
Fields§
§stage: S§state: S::State§inputs: S::Input§outputs: S::Output§cache: HashMap<u64, Vec<Cached<S>>>§input_changed: boolImplementations§
Trait Implementations§
Source§impl<S: Stage + Send + Sync + 'static> AnyNode for Node<S>
impl<S: Stage + Send + Sync + 'static> AnyNode for Node<S>
Source§fn stage_shape(&self) -> &'static StageShape
fn stage_shape(&self) -> &'static StageShape
Gets the shape of the stage
Source§fn into_any(self: Box<Self>) -> Box<dyn Any>
fn into_any(self: Box<Self>) -> Box<dyn Any>
Upcast to
dyn Any to get its more-specific downcast capabilitiesSource§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
USed to get mutable access to state
fn reeval_rule(&self) -> ReevaluationRule
Source§fn eval(&mut self) -> Result<Box<dyn DynFields>, InjectionError>
fn eval(&mut self) -> Result<Box<dyn DynFields>, InjectionError>
Evaluates the node. Returns a map of prior outputs
Source§fn flow_data(
&mut self,
child: &mut Box<dyn AnyNode>,
output: Option<&'static str>,
input: Option<&'static str>,
) -> Result<(), InjectionError>
fn flow_data( &mut self, child: &mut Box<dyn AnyNode>, output: Option<&'static str>, input: Option<&'static str>, ) -> Result<(), InjectionError>
This a a core part of the plumbing of this crate - take the outputs of
a parent node and use them to set the inputs of a child node.
Source§fn inputs_mut(&mut self) -> &mut dyn DynFields
fn inputs_mut(&mut self) -> &mut dyn DynFields
Used to support
[Self::flow_data]Source§fn outputs_mut(&mut self) -> &mut dyn DynFields
fn outputs_mut(&mut self) -> &mut dyn DynFields
Used to support
[Self::flow_data]Source§fn set_input_changed(&mut self, val: bool)
fn set_input_changed(&mut self, val: bool)
Used to indicate that an input has been modified from a previous run.
Source§fn input_changed(&self) -> bool
fn input_changed(&self) -> bool
See
[Self::set_input_changed]