pub struct MeteredSender<T> { /* private fields */ }
Available on crate feature
common
only.Expand description
A wrapper type around Sender that updates metrics on send.
Implementations§
Source§impl<T> MeteredSender<T>
impl<T> MeteredSender<T>
Sourcepub fn new(sender: Sender<T>, scope: &'static str) -> Self
pub fn new(sender: Sender<T>, scope: &'static str) -> Self
Creates a new MeteredSender
wrapping around the provided Sender
Sourcepub fn try_reserve_owned(
&self,
) -> Result<OwnedPermit<T>, TrySendError<Sender<T>>>
pub fn try_reserve_owned( &self, ) -> Result<OwnedPermit<T>, TrySendError<Sender<T>>>
Tries to acquire a permit to send a message.
See also Sender’s try_reserve_owned
.
Trait Implementations§
Source§impl<T> Clone for MeteredSender<T>
impl<T> Clone for MeteredSender<T>
Auto Trait Implementations§
impl<T> Freeze for MeteredSender<T>
impl<T> !RefUnwindSafe for MeteredSender<T>
impl<T> Send for MeteredSender<T>where
T: Send,
impl<T> Sync for MeteredSender<T>where
T: Send,
impl<T> Unpin for MeteredSender<T>
impl<T> !UnwindSafe for MeteredSender<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes