Skip to main content

Module source

Module source 

Source
Expand description

Source node traits and adapters.

This module defines a minimal Source trait and a SourceNode adapter that plugs a source into the existing Node and Edge contracts without changing any runtime or graph APIs. It also includes: //! - SourceIngressEdge: a borrowing, no-alloc adapter that exposes ingress pressure (items/bytes before the source) as an Edge so that the graph and runtimes can uniformly sample it with their existing occupancy code.

  • IngressProbe / NoProbe / IngressProbeImpl: platform-agnostic ingress pressure observer — zero-cost NoProbe by default; replace for real occupancy

§Design notes

  • A Source has no input ports and one or more output ports. It can produce at most one message per step() via try_produce().
  • Ingress pressure is surfaced via ingress_occupancy(), which the graph exposes as a synthetic “monitor edge” using SourceIngressEdge (no_std) or probe::SourceIngressProbeEdge (std). Runtimes keep using GraphApi::(edge_)occupancy without any special-case code.

Modules§

probe
Std-only, lock-free ingress pressure probe for cross-thread sources.

Structs§

IngressEdgeLink
A tiny link wrapper for the synthetic ingress edge.
NoProbe
Zero-cost stub used on no_std targets where no real probe is wired up.
SourceIngressEdge
Borrowing adapter that exposes a source’s ingress pressure as an Edge.
SourceNode
A thin adapter that exposes a Source as a Node<0, OUT, (), OutP>.

Constants§

EXTERNAL_INGRESS_NODE
Reserved node index used for virtual input nodes.

Traits§

IngressProbe
Platform-agnostic ingress pressure observer.
Source
Uniform contract for source implementations (0 inputs / ≥1 outputs).

Type Aliases§

IngressProbeImpl
Concrete ingress probe type used on std targets.