pub struct OwnedRankedSemaphorePermit { /* private fields */ }Expand description
Semaphore permit (owned version)
Implementations§
Source§impl OwnedRankedSemaphorePermit
impl OwnedRankedSemaphorePermit
Sourcepub fn num_permits(&self) -> usize
pub fn num_permits(&self) -> usize
Get number of permits
Sourcepub fn merge(&mut self, other: Self)
pub fn merge(&mut self, other: Self)
Merges another permit into this one. Both permits must belong to the same semaphore.
Sourcepub fn split(&mut self, n: usize) -> Option<Self>
pub fn split(&mut self, n: usize) -> Option<Self>
Splits n permits from this permit, returning a new owned permit. If there are insufficient permits and it’s not possible to reduce by n, returns None.
Sourcepub fn semaphore(&self) -> &Arc<RankedSemaphore>
pub fn semaphore(&self) -> &Arc<RankedSemaphore>
Returns the Semaphore from which this permit was acquired.
Trait Implementations§
Source§impl Debug for OwnedRankedSemaphorePermit
impl Debug for OwnedRankedSemaphorePermit
Auto Trait Implementations§
impl Freeze for OwnedRankedSemaphorePermit
impl RefUnwindSafe for OwnedRankedSemaphorePermit
impl Send for OwnedRankedSemaphorePermit
impl Sync for OwnedRankedSemaphorePermit
impl Unpin for OwnedRankedSemaphorePermit
impl UnwindSafe for OwnedRankedSemaphorePermit
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