pub trait AnalysisNode: 'static {
type State: 'static;
// Required methods
fn name(&self) -> &'static str;
fn evaluate(
&mut self,
ctx: &AnalysisStateContext<'_>,
) -> SubtrActorResult<()>;
fn state(&self) -> &Self::State;
// Provided methods
fn emitted_events(&self) -> &'static [EmittedEvent] { ... }
fn on_replay_meta(&mut self, _meta: &ReplayMeta) -> SubtrActorResult<()> { ... }
fn dependencies(&self) -> Vec<AnalysisDependency> { ... }
fn finish(
&mut self,
_ctx: &AnalysisStateContext<'_>,
) -> SubtrActorResult<()> { ... }
}Expand description
A node in the AnalysisGraph: consumes upstream state, runs once per
frame, and exposes its own typed state for downstream nodes.
Implementors are the catalog of analysis nodes (see the
nodes module and the Implementors list
below). A node declares what it reads via
dependencies, reads it from the
AnalysisStateContext in evaluate, and
publishes State via state.
The blanket AnalysisNodeDyn impl makes every AnalysisNode usable as a
boxed graph node.
Required Associated Types§
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable identifier for this node, used for dependency wiring and the built-in node registry.
fn evaluate(&mut self, ctx: &AnalysisStateContext<'_>) -> SubtrActorResult<()>
fn state(&self) -> &Self::State
Provided Methods§
Sourcefn emitted_events(&self) -> &'static [EmittedEvent]
fn emitted_events(&self) -> &'static [EmittedEvent]
Static catalog of the events this node emits, if any.
The node is the source of truth for what it produces: a graph’s emitted
events come from walking its actual nodes (see
AnalysisGraph::emitted_events), so there is no name-keyed side
registry that can drift out of sync with the nodes themselves.
fn on_replay_meta(&mut self, _meta: &ReplayMeta) -> SubtrActorResult<()>
fn dependencies(&self) -> Vec<AnalysisDependency>
fn finish(&mut self, _ctx: &AnalysisStateContext<'_>) -> SubtrActorResult<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".