pub struct Permit<'sem> { /* private fields */ }
Expand description
A RAII guard representing one or more permits acquired from a
Semaphore
.
When the Permit
is dropped, the permits it represents are released back to
the Semaphore
, potentially waking another task.
This type is returned by the Semaphore::acquire
and
Semaphore::try_acquire
methods.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'sem> Freeze for Permit<'sem>
impl<'sem> !RefUnwindSafe for Permit<'sem>
impl<'sem> Send for Permit<'sem>
impl<'sem> Sync for Permit<'sem>
impl<'sem> Unpin for Permit<'sem>
impl<'sem> !UnwindSafe for Permit<'sem>
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