AnyNode

Trait AnyNode 

Source
pub trait AnyNode:
    Any
    + Send
    + Sync
    + 'static {
Show 13 methods // Required methods fn stage_shape(&self) -> &'static StageShape; fn into_any(self: Box<Self>) -> Box<dyn Any>; fn as_any(&self) -> &dyn Any; fn as_any_mut(&mut self) -> &mut dyn Any; fn eval(&mut self) -> Result<Box<dyn DynFields>, InjectionError>; fn reeval_rule(&self) -> ReevaluationRule; fn flow_data( &mut self, child: &mut Box<dyn AnyNode>, output: Option<&'static str>, input: Option<&'static str>, ) -> Result<(), InjectionError>; fn inputs_mut(&mut self) -> &mut dyn DynFields; fn outputs_mut(&mut self) -> &mut dyn DynFields; fn set_input_changed(&mut self, val: bool); fn input_changed(&self) -> bool; fn cache_mut(&mut self) -> &mut dyn Any; fn clear_state(&mut self);
}
Expand description

This is used to type-erase a node. It’s public because the macro needs to use this, but there should be no reason anyone should manually implement this.

Required Methods§

Source

fn stage_shape(&self) -> &'static StageShape

Gets the shape of the stage

Source

fn into_any(self: Box<Self>) -> Box<dyn Any>

Upcast to dyn Any to get its more-specific downcast capabilities

Source

fn as_any(&self) -> &dyn Any

Primarily used for internal checks

Source

fn as_any_mut(&mut self) -> &mut dyn Any

USed to get mutable access to state

Source

fn eval(&mut self) -> Result<Box<dyn DynFields>, InjectionError>

Evaluates the node. Returns a map of prior outputs

Source

fn reeval_rule(&self) -> ReevaluationRule

Source

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

Used to support [Self::flow_data]

Source

fn outputs_mut(&mut self) -> &mut dyn DynFields

Used to support [Self::flow_data]

Source

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

See [Self::set_input_changed]

Source

fn cache_mut(&mut self) -> &mut dyn Any

Source

fn clear_state(&mut self)

Implementors§

Source§

impl<S: Stage + Send + Sync + 'static> AnyNode for Node<S>