Struct tokio::sync::OwnedSemaphorePermit
source · [−]pub struct OwnedSemaphorePermit { /* private fields */ }
Expand description
An owned permit from the semaphore.
This type is created by the acquire_owned
method.
Implementations
sourceimpl OwnedSemaphorePermit
impl OwnedSemaphorePermit
sourcepub fn forget(self)
pub fn forget(self)
Forgets the permit without releasing it back to the semaphore. This can be used to reduce the amount of permits available from a semaphore.
sourcepub fn merge(&mut self, other: Self)
pub fn merge(&mut self, other: Self)
Merge two OwnedSemaphorePermit
instances together, consuming other
without releasing the permits it holds.
Permits held by both self
and other
are released when self
drops.
Panics
This function panics if permits from different Semaphore
instances
are merged.
Trait Implementations
sourceimpl Debug for OwnedSemaphorePermit
impl Debug for OwnedSemaphorePermit
Auto Trait Implementations
impl !RefUnwindSafe for OwnedSemaphorePermit
impl Send for OwnedSemaphorePermit
impl Sync for OwnedSemaphorePermit
impl Unpin for OwnedSemaphorePermit
impl !UnwindSafe for OwnedSemaphorePermit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more