#[non_exhaustive]pub struct NodeLink<N, const IN: usize, const OUT: usize, InP, OutP>{ /* private fields */ }Expand description
A lightweight descriptor that links to a concrete node instance and records its static topology and policy metadata.
Unlike a pure descriptor, NodeLink owns the concrete node instance (N)
and records its identity, kind, port counts, policy, and optional name for graph
construction, scheduling, diagnostics, and tooling. It exposes &N and &mut N
accessors so runtimes can operate on the live node.
§Type Parameters
'a: Lifetime of the borrowed node reference. The descriptor cannot outlive the node.N: Concrete node type implementingNode<IN, OUT, InP, OutP>.IN: Compile-time number of input ports for the node.OUT: Compile-time number of output ports for the node.InP: Input payload type (must implementPayload).OutP: Output payload type (must implementPayload).
§Invariants
Callers should ensure in_ports == IN as u16 and out_ports == OUT as u16 so the
stored counts are consistent with the node’s const-generic port arity.
Implementations§
Source§impl<N, const IN: usize, const OUT: usize, InP, OutP> NodeLink<N, IN, OUT, InP, OutP>
impl<N, const IN: usize, const OUT: usize, InP, OutP> NodeLink<N, IN, OUT, InP, OutP>
Sourcepub fn new(node: N, id: NodeIndex, name: Option<&'static str>) -> Self
pub fn new(node: N, id: NodeIndex, name: Option<&'static str>) -> Self
Construct a new NodeLink that borrows the given node and records its metadata.
§Parameters
node: Borrowed reference to the concrete node instance.id: Unique identifier of the node in the graph.name: Optional static name for diagnostics or tooling.
Sourcepub fn input_port_ids(&self) -> [PortId; IN]
pub fn input_port_ids(&self) -> [PortId; IN]
Returns the input port ids for the node.
Sourcepub fn output_port_ids(&self) -> [PortId; OUT]
pub fn output_port_ids(&self) -> [PortId; OUT]
Returns the input port ids for the node.
Sourcepub fn policy(&self) -> NodePolicy
pub fn policy(&self) -> NodePolicy
Return the node’s policy bundle.
Sourcepub fn descriptor(&self) -> NodeDescriptor
pub fn descriptor(&self) -> NodeDescriptor
Return the NodeDescriptor for this NodeLink.
Trait Implementations§
Source§impl<N, const IN: usize, const OUT: usize, InP, OutP> Clone for NodeLink<N, IN, OUT, InP, OutP>
impl<N, const IN: usize, const OUT: usize, InP, OutP> Clone for NodeLink<N, IN, OUT, InP, OutP>
Source§impl<N, const IN: usize, const OUT: usize, InP, OutP> Debug for NodeLink<N, IN, OUT, InP, OutP>
impl<N, const IN: usize, const OUT: usize, InP, OutP> Debug for NodeLink<N, IN, OUT, InP, OutP>
Source§impl<N, const IN: usize, const OUT: usize, InP, OutP> Node<IN, OUT, InP, OutP> for NodeLink<N, IN, OUT, InP, OutP>
impl<N, const IN: usize, const OUT: usize, InP, OutP> Node<IN, OUT, InP, OutP> for NodeLink<N, IN, OUT, InP, OutP>
Source§fn set_policy(&mut self, policy: NodePolicy)
fn set_policy(&mut self, policy: NodePolicy)
TEST ONLY method used to override batching policis for node contract tests.
Source§fn describe_capabilities(&self) -> NodeCapabilities
fn describe_capabilities(&self) -> NodeCapabilities
Source§fn input_acceptance(&self) -> [PlacementAcceptance; IN]
fn input_acceptance(&self) -> [PlacementAcceptance; IN]
Source§fn output_acceptance(&self) -> [PlacementAcceptance; OUT]
fn output_acceptance(&self) -> [PlacementAcceptance; OUT]
Source§fn policy(&self) -> NodePolicy
fn policy(&self) -> NodePolicy
Source§fn initialize<C, T>(
&mut self,
clock: &C,
telemetry: &mut T,
) -> Result<(), NodeError>where
T: Telemetry,
fn initialize<C, T>(
&mut self,
clock: &C,
telemetry: &mut T,
) -> Result<(), NodeError>where
T: Telemetry,
Source§fn start<C, T>(&mut self, clock: &C, telemetry: &mut T) -> Result<(), NodeError>where
T: Telemetry,
fn start<C, T>(&mut self, clock: &C, telemetry: &mut T) -> Result<(), NodeError>where
T: Telemetry,
Source§fn process_message<C>(
&mut self,
msg: &Message<InP>,
sys_clock: &C,
) -> Result<ProcessResult<OutP>, NodeError>where
C: PlatformClock + Sized,
fn process_message<C>(
&mut self,
msg: &Message<InP>,
sys_clock: &C,
) -> Result<ProcessResult<OutP>, NodeError>where
C: PlatformClock + Sized,
Source§fn step<'graph, 'telemetry, 'clock, InQ, OutQ, InM, OutM, C, T>(
&mut self,
ctx: &mut StepContext<'graph, 'telemetry, 'clock, IN, OUT, InP, OutP, InQ, OutQ, InM, OutM, C, T>,
) -> Result<StepResult, NodeError>where
InQ: Edge,
OutQ: Edge,
InM: MemoryManager<InP>,
OutM: MemoryManager<OutP>,
C: PlatformClock + Sized,
T: Telemetry + Sized,
fn step<'graph, 'telemetry, 'clock, InQ, OutQ, InM, OutM, C, T>(
&mut self,
ctx: &mut StepContext<'graph, 'telemetry, 'clock, IN, OUT, InP, OutP, InQ, OutQ, InM, OutM, C, T>,
) -> Result<StepResult, NodeError>where
InQ: Edge,
OutQ: Edge,
InM: MemoryManager<InP>,
OutM: MemoryManager<OutP>,
C: PlatformClock + Sized,
T: Telemetry + Sized,
Source§fn step_batch<'graph, 'telemetry, 'clock, InQ, OutQ, InM, OutM, C, T>(
&mut self,
ctx: &mut StepContext<'graph, 'telemetry, 'clock, IN, OUT, InP, OutP, InQ, OutQ, InM, OutM, C, T>,
) -> Result<StepResult, NodeError>where
InQ: Edge,
OutQ: Edge,
InM: MemoryManager<InP>,
OutM: MemoryManager<OutP>,
C: PlatformClock + Sized,
T: Telemetry + Sized,
fn step_batch<'graph, 'telemetry, 'clock, InQ, OutQ, InM, OutM, C, T>(
&mut self,
ctx: &mut StepContext<'graph, 'telemetry, 'clock, IN, OUT, InP, OutP, InQ, OutQ, InM, OutM, C, T>,
) -> Result<StepResult, NodeError>where
InQ: Edge,
OutQ: Edge,
InM: MemoryManager<InP>,
OutM: MemoryManager<OutP>,
C: PlatformClock + Sized,
T: Telemetry + Sized,
process_message() method.