pub struct Node<S: Stage> { /* private fields */ }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
Implementations§
Trait Implementations§
Source§impl<S: Stage + 'static> AnyNode for Node<S>
impl<S: Stage + 'static> AnyNode for Node<S>
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 eval_strategy(&self) -> EvalStrategy
fn reeval_rule(&self) -> ReevaluationRule
Source§fn replace_output(
&mut self,
key: &DataLabel,
output: Arc<dyn Any + Send + Sync>,
) -> Result<Option<Arc<dyn Any + Send + Sync>>, InjectionError>
fn replace_output( &mut self, key: &DataLabel, output: Arc<dyn Any + Send + Sync>, ) -> Result<Option<Arc<dyn Any + Send + Sync>>, InjectionError>
Set the outputs and return any existing outputs.
Source§fn eval(
&mut self,
) -> Result<HashMap<DataLabel, Arc<dyn Any + Send + Sync>>, InjectionError>
fn eval( &mut self, ) -> Result<HashMap<DataLabel, Arc<dyn Any + Send + Sync>>, InjectionError>
Evaluates the node. Returns a map of prior outputs
Source§fn flow_data(
&mut self,
parent: &mut Box<dyn AnyNode>,
output: DataLabel,
input: DataLabel,
) -> Result<(), InjectionError>
fn flow_data( &mut self, parent: &mut Box<dyn AnyNode>, output: DataLabel, input: DataLabel, ) -> 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 HashMap<DataLabel, (Arc<dyn Any + Send + Sync>, ReevaluationRule)>
fn inputs_mut( &mut self, ) -> &mut HashMap<DataLabel, (Arc<dyn Any + Send + Sync>, ReevaluationRule)>
Used to support
[Self::flow_data]Source§fn outputs_mut(&mut self) -> &mut HashMap<DataLabel, Arc<dyn Any + Send + Sync>>
fn outputs_mut(&mut self) -> &mut HashMap<DataLabel, Arc<dyn Any + Send + Sync>>
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]Source§fn input_reftype(&self, name: &DataLabel) -> Option<RefType>
fn input_reftype(&self, name: &DataLabel) -> Option<RefType>
Look of the reftype of a particular input
fn input_names(&self) -> Cloned<Keys<'_, DataLabel, (TypeId, RefType)>>
fn output_names(&self) -> Cloned<Keys<'_, DataLabel, TypeId>>
fn stage_name(&self) -> &str
Auto Trait Implementations§
impl<S> Freeze for Node<S>
impl<S> !RefUnwindSafe for Node<S>
impl<S> Send for Node<S>
impl<S> Sync for Node<S>
impl<S> Unpin for Node<S>
impl<S> !UnwindSafe for Node<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more