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-costNoProbeby default; replace for real occupancy
§Design notes
- A
Sourcehas no input ports and one or more output ports. It can produce at most one message perstep()viatry_produce(). - Ingress pressure is surfaced via
ingress_occupancy(), which the graph exposes as a synthetic “monitor edge” usingSourceIngressEdge(no_std) orprobe::SourceIngressProbeEdge(std). Runtimes keep usingGraphApi::(edge_)occupancywithout any special-case code.
Modules§
- probe
- Std-only, lock-free ingress pressure probe for cross-thread sources.
Structs§
- Ingress
Edge Link - 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.
- Source
Ingress Edge - Borrowing adapter that exposes a source’s ingress pressure as an
Edge. - Source
Node - A thin adapter that exposes a
Sourceas aNode<0, OUT, (), OutP>.
Constants§
- EXTERNAL_
INGRESS_ NODE - Reserved node index used for virtual input nodes.
Traits§
- Ingress
Probe - Platform-agnostic ingress pressure observer.
- Source
- Uniform contract for source implementations (0 inputs / ≥1 outputs).
Type Aliases§
- Ingress
Probe Impl - Concrete ingress probe type used on
stdtargets.