Skip to main content

Module traits

Module traits 

Source
Expand description

Common traits for event producers and consumers.

These traits abstract over the different ring buffer types so that generic code can work with any combination of producer and consumer.

TraitRoleImplementors
SinkAccept eventsRingBuf, seq_ring::Producer, event_buf::Producer
SourceYield eventsseq_ring::Consumer, event_buf::Consumer
LinkBoth — accept and yieldBlanket impl for any Sink<In> + Source<Out>
LatestSinkPublish a newest valuelatest_buf::Producer
LatestSourceTake the newest value with replacement/skipped evidencelatest_buf::Consumer

forward bridges Source into Sink only — the stream pair. LatestBuf’s handles implement the latest-value pair instead, by decision D2: try_pop cannot report the displacement that is that channel’s designed overload behaviour.

The free function forward transfers items from any Source to any Sink, stopping when the source is empty or the sink rejects a value.

Traits§

LatestSink
Publish complete newest-state values with replacement evidence.
LatestSource
Take the latest complete state together with generation and gap evidence.
Link
A bidirectional pass-through: accepts In and yields Out.
Sink
Accept events.
Source
Yield events.

Functions§

forward
Transfer up to max items from a Source into a Sink.