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>

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§

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.