pub struct EventFanIn<T> { /* private fields */ }Expand description
Mints the tagged sinks that feed one merged stream.
The order of operations is the API: mint every sink, then call
into_events to start consuming. That is not
ceremony — consuming takes the fan-in by value, so the sender it holds goes
with it, and the merged stream can end when the last sink is dropped
without depending on the host remembering to drop the factory too.
Implementations§
Source§impl<T> EventFanIn<T>
impl<T> EventFanIn<T>
pub fn new() -> Self
Sourcepub fn sink(&self, tag: T) -> TaggedSink<T>
pub fn sink(&self, tag: T) -> TaggedSink<T>
Mints a sink that labels everything it carries with tag.
Sinks are Send, so this is the handle that goes to the run —
PreparedRun::execute and its
neighbours take one by value.
Sourcepub fn into_events(self) -> MergedEvents<T>
pub fn into_events(self) -> MergedEvents<T>
Starts consuming, closing minting.
Taking self is the point: the fan-in’s own sender is dropped here, so
from this call on the only senders alive are the sinks that were minted,
and “every sink is gone” is a state the consumer can actually reach.
Trait Implementations§
Source§impl<T> Debug for EventFanIn<T>
Hand-written so the type prints as what it is rather than requiring a
T: Debug a tag has no reason to carry.
impl<T> Debug for EventFanIn<T>
Hand-written so the type prints as what it is rather than requiring a
T: Debug a tag has no reason to carry.