Skip to main content

Module sink

Module sink 

Source
Expand description

Sink node trait and adapter.

A Sink has ≥1 inputs and 0 outputs. It consumes messages from one input per step() and commits them to an external side effect (file, stdout, GPIO, network, etc.). No dynamic dispatch in the hot path; everything is monomorphized.

Design goals:

  • Minimal trait to implement a new sink.
  • Default input-selection strategy (first non-empty), overridable per sink.
  • Adapter SinkNode<S, InP, IN> that implements Node<IN, 0, InP, ()>.
  • Implicit From<S> so graphs can take impl Into<SinkNode<...>> and users never have to mention the adapter type.

Structs§

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

Traits§

Sink
Uniform contract for sink implementations (≥1 inputs / 0 outputs).