pub trait Stage: Clone {
type State;
// Required methods
fn inputs(&self) -> &HashMap<DataLabel, (TypeId, RefType)>;
fn outputs(&self) -> &HashMap<DataLabel, TypeId>;
fn evaluate(
&self,
state: &mut Self::State,
inputs: &mut HashMap<DataLabel, (Arc<dyn Any + Send + Sync>, ReevaluationRule)>,
cache: &mut HashMap<u64, Vec<Cached>>,
) -> Result<NodeOutput, InjectionError>;
fn inject_input(
&self,
node: &mut Node<Self>,
parent: &mut Box<dyn AnyNode>,
output: DataLabel,
input: DataLabel,
) -> Result<(), InjectionError>;
fn name(&self) -> &str;
// Provided methods
fn eval_strategy(&self) -> EvalStrategy { ... }
fn reeval_rule(&self) -> ReevaluationRule { ... }
}
Expand description
Defines all the information about how a stage is handled.
Required Associated Types§
Required Methods§
Sourcefn evaluate(
&self,
state: &mut Self::State,
inputs: &mut HashMap<DataLabel, (Arc<dyn Any + Send + Sync>, ReevaluationRule)>,
cache: &mut HashMap<u64, Vec<Cached>>,
) -> Result<NodeOutput, InjectionError>
fn evaluate( &self, state: &mut Self::State, inputs: &mut HashMap<DataLabel, (Arc<dyn Any + Send + Sync>, ReevaluationRule)>, cache: &mut HashMap<u64, Vec<Cached>>, ) -> Result<NodeOutput, InjectionError>
Evaluate the stage with the given input and state
Sourcefn inject_input(
&self,
node: &mut Node<Self>,
parent: &mut Box<dyn AnyNode>,
output: DataLabel,
input: DataLabel,
) -> Result<(), InjectionError>
fn inject_input( &self, node: &mut Node<Self>, parent: &mut Box<dyn AnyNode>, output: DataLabel, input: DataLabel, ) -> Result<(), InjectionError>
Stage-level connection processing logic. See Node::flow_data for more information.
Provided Methods§
fn eval_strategy(&self) -> EvalStrategy
fn reeval_rule(&self) -> ReevaluationRule
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.