pub struct OwnedPermit<T> { /* private fields */ }
Available on crate feature
common
only.Expand description
A wrapper type around OwnedPermit
that updates metrics accounting
when sending
Implementations§
Source§impl<T> OwnedPermit<T>
impl<T> OwnedPermit<T>
Sourcepub const fn new(permit: OwnedPermit<T>, metrics: MeteredSenderMetrics) -> Self
pub const fn new(permit: OwnedPermit<T>, metrics: MeteredSenderMetrics) -> Self
Creates a new OwnedPermit
wrapping the provided [mpsc::OwnedPermit
] with given metrics
handle.
Sourcepub fn send(self, value: T) -> MeteredSender<T>
pub fn send(self, value: T) -> MeteredSender<T>
Sends a value using the reserved capacity and update metrics accordingly.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for OwnedPermit<T>
impl<T> !RefUnwindSafe for OwnedPermit<T>
impl<T> Send for OwnedPermit<T>where
T: Send,
impl<T> Sync for OwnedPermit<T>where
T: Send,
impl<T> Unpin for OwnedPermit<T>
impl<T> !UnwindSafe for OwnedPermit<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
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