pub struct AdjustableSemaphorePermit { /* private fields */ }Expand description
A permit issued by the AdjustableSemaphore. On drop, this attempts to resolve any enqueued permit decrease if one is needed.
Implementations§
Source§impl AdjustableSemaphorePermit
impl AdjustableSemaphorePermit
Sourcepub fn num_permits(&self) -> u64
pub fn num_permits(&self) -> u64
The number of logical permits held by this permit (scaled by basis).
Sourcepub fn num_physical_permits(&self) -> u32
pub fn num_physical_permits(&self) -> u32
The number of internal (physical) permits held by this permit.
Sourcepub fn split(&mut self, n: u64) -> Option<AdjustableSemaphorePermit>
pub fn split(&mut self, n: u64) -> Option<AdjustableSemaphorePermit>
Split n logical permits off this permit into a new permit.
Returns None if n is zero or the scaled physical count exceeds
what this permit holds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdjustableSemaphorePermit
impl RefUnwindSafe for AdjustableSemaphorePermit
impl Send for AdjustableSemaphorePermit
impl Sync for AdjustableSemaphorePermit
impl Unpin for AdjustableSemaphorePermit
impl UnsafeUnpin for AdjustableSemaphorePermit
impl UnwindSafe for AdjustableSemaphorePermit
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