Struct sc_utils::status_sinks::StatusSinks
source · pub struct StatusSinks<T> { /* private fields */ }
Expand description
Holds a list of UnboundedSender
s, each associated with a certain time period. Every time the
period elapses, we push an element on the sender.
Senders are removed only when they are closed.
Implementations§
source§impl<T> StatusSinks<T>
impl<T> StatusSinks<T>
sourcepub fn new() -> StatusSinks<T>
pub fn new() -> StatusSinks<T>
Builds a new empty collection.
sourcepub fn push(&self, interval: Duration, sender: TracingUnboundedSender<T>)
pub fn push(&self, interval: Duration, sender: TracingUnboundedSender<T>)
Adds a sender to the collection.
The interval
is the time period between two pushes on the sender.
sourcepub async fn next(&self) -> ReadySinkEvent<'_, T>
pub async fn next(&self) -> ReadySinkEvent<'_, T>
Waits until one of the sinks is ready, then returns an object that can be used to send an element on said sink.
If the object isn’t used to send an element, the slot is skipped.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for StatusSinks<T>
impl<T> Send for StatusSinks<T>where T: Send,
impl<T> Sync for StatusSinks<T>where T: Send,
impl<T> Unpin for StatusSinks<T>
impl<T> !UnwindSafe for StatusSinks<T>
Blanket Implementations§
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.