Skip to main content

SinkNode

Struct SinkNode 

Source
pub struct SinkNode<S, InP, const IN: usize>
where S: Sink<InP, IN>, InP: Payload,
{ /* private fields */ }
Expand description

A thin adapter that exposes a Sink as a Node<IN, 0, InP, ()>.

Owns the sink and forwards lifecycle calls. Users do not construct this directly — graphs can accept impl Into<SinkNode<...>> and rely on From<S>.

Implementations§

Source§

impl<S, InP, const IN: usize> SinkNode<S, InP, IN>
where S: Sink<InP, IN>, InP: Payload,

Source

pub const fn new(sink: S, policy: NodePolicy) -> Self

Construct a SinkNode from a sink and a static policy bundle.

Source

pub fn sink_ref(&self) -> &S

Borrow the underlying sink.

Source

pub fn sink_mut(&mut self) -> &mut S

Mutably borrow the underlying sink.

Trait Implementations§

Source§

impl<S, InP, const IN: usize> From<S> for SinkNode<S, InP, IN>
where S: Sink<InP, IN>, InP: Payload,

Allow graphs to accept any Sink and convert implicitly.

Source§

fn from(sink: S) -> Self

Converts to this type from the input type.
Source§

impl<S, InP, const IN: usize> Node<IN, 0, InP, ()> for SinkNode<S, InP, IN>
where S: Sink<InP, IN>, InP: Payload + Copy,

Source§

fn set_policy(&mut self, policy: NodePolicy)

TEST ONLY method used to override batching policies for node contract tests.

Source§

fn describe_capabilities(&self) -> NodeCapabilities

Return the node’s capability descriptor.
Source§

fn input_acceptance(&self) -> [PlacementAcceptance; IN]

Return the node’s port placement acceptances (zero-copy compatibility).
Source§

fn output_acceptance(&self) -> [PlacementAcceptance; 0]

Return the node’s output placement preferences (zero-copy compatibility).
Source§

fn policy(&self) -> NodePolicy

Return the node’s policy bundle.
Source§

fn node_kind(&self) -> NodeKind

Return the type of node (Model, processing, source, sink).
Source§

fn initialize<C, T>(&mut self, _c: &C, _t: &mut T) -> Result<(), NodeError>
where T: Telemetry,

Prepare internal state, acquire buffers, and register telemetry series.
Source§

fn start<C, T>(&mut self, _c: &C, _t: &mut T) -> Result<(), NodeError>
where T: Telemetry,

Optional warm-up (e.g., compile kernels, prime pools). Default: no-op.
Source§

fn process_message<C>( &mut self, msg: &Message<InP>, _sys_clock: &C, ) -> Result<ProcessResult<()>, NodeError>
where C: PlatformClock + Sized,

Per-message processing hook. Read more
Source§

fn step<'g, 't, 'ck, InQ, OutQ, InM, OutM, C, Tel>( &mut self, cx: &mut StepContext<'g, 't, 'ck, IN, 0, InP, (), InQ, OutQ, InM, OutM, C, Tel>, ) -> Result<StepResult, NodeError>
where InQ: Edge, OutQ: Edge, InM: MemoryManager<InP>, OutM: MemoryManager<()>, C: PlatformClock + Sized, Tel: Telemetry + Sized,

Execute one cooperative step using the provided context. Read more
Source§

fn step_batch<'graph, 'telemetry, 'clock, InQ, OutQ, InM, OutM, C, Tel>( &mut self, ctx: &mut StepContext<'graph, 'telemetry, 'clock, IN, 0, InP, (), InQ, OutQ, InM, OutM, C, Tel>, ) -> Result<StepResult, NodeError>
where InQ: Edge, OutQ: Edge, InM: MemoryManager<InP>, OutM: MemoryManager<()>, C: PlatformClock + Sized, Tel: Telemetry + Sized,

Default batched-step implementation that honors all NodePolicy batching variants while delegating actual consumption to the implementor’s single-message process_message() method.
Source§

fn on_watchdog_timeout<C, Tel>( &mut self, clock: &C, _t: &mut Tel, ) -> Result<StepResult, NodeError>
where C: PlatformClock + Sized, Tel: Telemetry,

Handle watchdog timeouts by applying over-budget policy (degrade/default/skip).
Source§

fn stop<C, Tel>(&mut self, _c: &C, _t: &mut Tel) -> Result<(), NodeError>
where Tel: Telemetry,

Flush and release resources, if any. Default: no-op.

Auto Trait Implementations§

§

impl<S, InP, const IN: usize> Freeze for SinkNode<S, InP, IN>
where S: Freeze,

§

impl<S, InP, const IN: usize> RefUnwindSafe for SinkNode<S, InP, IN>

§

impl<S, InP, const IN: usize> Send for SinkNode<S, InP, IN>
where S: Send, InP: Send,

§

impl<S, InP, const IN: usize> Sync for SinkNode<S, InP, IN>
where S: Sync, InP: Sync,

§

impl<S, InP, const IN: usize> Unpin for SinkNode<S, InP, IN>
where S: Unpin, InP: Unpin,

§

impl<S, InP, const IN: usize> UnsafeUnpin for SinkNode<S, InP, IN>
where S: UnsafeUnpin,

§

impl<S, InP, const IN: usize> UnwindSafe for SinkNode<S, InP, IN>
where S: UnwindSafe, InP: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.