pub struct GenericSharedSemaphoreReleaser<MutexType: RawMutex> { /* private fields */ }
Expand description
An RAII guard returned by the acquire
and try_acquire
methods.
When this structure is dropped (falls out of scope),
the amount of permits that was used in the acquire()
call will be released
back to the Semaphore.
Implementations
sourcepub fn disarm(&mut self) -> usize
pub fn disarm(&mut self) -> usize
Prevents the SharedSemaphoreReleaser from automatically releasing the permits when it gets dropped.
This is helpful if the permits must be acquired for a longer lifetime than the one of the SemaphoreReleaser.
If this method is used it is important to release the acquired permits manually back to the Semaphore.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more