pub struct OwnedPermit<Lock = Spinlock>where
    Lock: RawMutex,{ /* private fields */ }Expand description
An owned RAII guard representing one or more permits acquired from a
Semaphore.
When the OwnedPermit is dropped, the permits it represents are
released back to  the Semaphore, potentially waking another task.
This type is identical to the Permit type, except that it holds an
Arc clone of the Semaphore, rather than borrowing it. This
allows the guard to be valid for the 'static lifetime.
This type is returned by the Semaphore::acquire_owned and
Semaphore::try_acquire_owned methods.
Implementations§
Source§impl<Lock> OwnedPermit<Lock>where
    Lock: RawMutex,
 
impl<Lock> OwnedPermit<Lock>where
    Lock: RawMutex,
Sourcepub fn forget(self)
 
pub fn forget(self)
Forget this permit, dropping it without returning the number of acquired permits to the semaphore.
This permanently decreases the number of permits in the semaphore by
self.permits().
Trait Implementations§
Source§impl<Lock> Debug for OwnedPermit<Lock>
 
impl<Lock> Debug for OwnedPermit<Lock>
Auto Trait Implementations§
impl<Lock> Freeze for OwnedPermit<Lock>
impl<Lock = Spinlock> !RefUnwindSafe for OwnedPermit<Lock>
impl<Lock> Send for OwnedPermit<Lock>
impl<Lock> Sync for OwnedPermit<Lock>
impl<Lock> Unpin for OwnedPermit<Lock>
impl<Lock = Spinlock> !UnwindSafe for OwnedPermit<Lock>
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