Struct sp_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
sourceimpl<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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more