pub trait GraphNodeContextBuilder<const I: usize, const IN: usize, const OUT: usize>: GraphNodeTypes<I, IN, OUT> {
// Required methods
fn make_step_context<'graph, 'telemetry, 'clock, C, T>(
&'graph mut self,
clock: &'clock C,
telemetry: &'telemetry mut T,
) -> StepContext<'graph, 'telemetry, 'clock, IN, OUT, <Self as GraphNodeTypes<I, IN, OUT>>::InP, <Self as GraphNodeTypes<I, IN, OUT>>::OutP, <Self as GraphNodeTypes<I, IN, OUT>>::InQ, <Self as GraphNodeTypes<I, IN, OUT>>::OutQ, <Self as GraphNodeTypes<I, IN, OUT>>::InM, <Self as GraphNodeTypes<I, IN, OUT>>::OutM, C, T>
where EdgePolicy: Copy,
C: PlatformClock + Sized,
T: Telemetry + Sized;
fn with_node_and_step_context<'telemetry, 'clock, C, T, R, E>(
&mut self,
clock: &'clock C,
telemetry: &'telemetry mut T,
f: impl FnOnce(&mut <Self as GraphNodeAccess<I>>::Node, &mut StepContext<'_, 'telemetry, 'clock, IN, OUT, <Self as GraphNodeTypes<I, IN, OUT>>::InP, <Self as GraphNodeTypes<I, IN, OUT>>::OutP, <Self as GraphNodeTypes<I, IN, OUT>>::InQ, <Self as GraphNodeTypes<I, IN, OUT>>::OutQ, <Self as GraphNodeTypes<I, IN, OUT>>::InM, <Self as GraphNodeTypes<I, IN, OUT>>::OutM, C, T>) -> Result<R, E>,
) -> Result<R, E>
where Self: GraphNodeAccess<I>,
EdgePolicy: Copy,
C: PlatformClock + Sized,
T: Telemetry + Sized;
}Expand description
Builder for per-node execution contexts.
This trait is implemented by the graph-building macro. It allows the runtime
to create a StepContext for a given node using compile-time wiring of its
ports, queues, and policies.
§Type Parameters
I: Compile-time index of the node within the graph.IN: Number of input ports for the node.OUT: Number of output ports for the node.
Required Methods§
Sourcefn make_step_context<'graph, 'telemetry, 'clock, C, T>(
&'graph mut self,
clock: &'clock C,
telemetry: &'telemetry mut T,
) -> StepContext<'graph, 'telemetry, 'clock, IN, OUT, <Self as GraphNodeTypes<I, IN, OUT>>::InP, <Self as GraphNodeTypes<I, IN, OUT>>::OutP, <Self as GraphNodeTypes<I, IN, OUT>>::InQ, <Self as GraphNodeTypes<I, IN, OUT>>::OutQ, <Self as GraphNodeTypes<I, IN, OUT>>::InM, <Self as GraphNodeTypes<I, IN, OUT>>::OutM, C, T>
fn make_step_context<'graph, 'telemetry, 'clock, C, T>( &'graph mut self, clock: &'clock C, telemetry: &'telemetry mut T, ) -> StepContext<'graph, 'telemetry, 'clock, IN, OUT, <Self as GraphNodeTypes<I, IN, OUT>>::InP, <Self as GraphNodeTypes<I, IN, OUT>>::OutP, <Self as GraphNodeTypes<I, IN, OUT>>::InQ, <Self as GraphNodeTypes<I, IN, OUT>>::OutQ, <Self as GraphNodeTypes<I, IN, OUT>>::InM, <Self as GraphNodeTypes<I, IN, OUT>>::OutM, C, T>
Construct a StepContext for node I.
§Parameters
clock: Reference to the runtime clock abstraction.telemetry: Mutable reference to the telemetry collector.
§Returns
A fully wired StepContext for the node, ready for execution.
Sourcefn with_node_and_step_context<'telemetry, 'clock, C, T, R, E>(
&mut self,
clock: &'clock C,
telemetry: &'telemetry mut T,
f: impl FnOnce(&mut <Self as GraphNodeAccess<I>>::Node, &mut StepContext<'_, 'telemetry, 'clock, IN, OUT, <Self as GraphNodeTypes<I, IN, OUT>>::InP, <Self as GraphNodeTypes<I, IN, OUT>>::OutP, <Self as GraphNodeTypes<I, IN, OUT>>::InQ, <Self as GraphNodeTypes<I, IN, OUT>>::OutQ, <Self as GraphNodeTypes<I, IN, OUT>>::InM, <Self as GraphNodeTypes<I, IN, OUT>>::OutM, C, T>) -> Result<R, E>,
) -> Result<R, E>
fn with_node_and_step_context<'telemetry, 'clock, C, T, R, E>( &mut self, clock: &'clock C, telemetry: &'telemetry mut T, f: impl FnOnce(&mut <Self as GraphNodeAccess<I>>::Node, &mut StepContext<'_, 'telemetry, 'clock, IN, OUT, <Self as GraphNodeTypes<I, IN, OUT>>::InP, <Self as GraphNodeTypes<I, IN, OUT>>::OutP, <Self as GraphNodeTypes<I, IN, OUT>>::InQ, <Self as GraphNodeTypes<I, IN, OUT>>::OutQ, <Self as GraphNodeTypes<I, IN, OUT>>::InM, <Self as GraphNodeTypes<I, IN, OUT>>::OutM, C, T>) -> Result<R, E>, ) -> Result<R, E>
Borrowed handoff: in one &mut self borrow, lend both
&mut node(I) and a fully wired StepContext to a closure.
This avoids overlapping &mut borrows escaping the call.
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.