pub struct Notifier<T> {
sender: Sender<T>,
}Expand description
Best-effort notification admission, independent of the write result.
The caller owns the notification payload, delivery handler and failure metrics.
Fields§
§sender: Sender<T>Implementations§
Source§impl<T> Notifier<T>
impl<T> Notifier<T>
Sourcepub fn try_new(capacity: usize) -> Option<(Self, Receiver<T>)>
pub fn try_new(capacity: usize) -> Option<(Self, Receiver<T>)>
Returns None if the queue capacity is zero or exceeds Tokio’s supported capacity.
Sourcepub fn max_capacity(&self) -> usize
pub fn max_capacity(&self) -> usize
Configured queue capacity, independent of its current occupancy.
Sourcepub fn try_notify(&self, notification: T) -> Result<(), TrySendError<T>>
pub fn try_notify(&self, notification: T) -> Result<(), TrySendError<T>>
Never waits for delivery. Returns the payload on a full or closed queue so the caller can record domain-specific diagnostics.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Notifier<T>
impl<T> RefUnwindSafe for Notifier<T>
impl<T> Send for Notifier<T>where
T: Send,
impl<T> Sync for Notifier<T>where
T: Send,
impl<T> Unpin for Notifier<T>
impl<T> UnsafeUnpin for Notifier<T>
impl<T> UnwindSafe for Notifier<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more