pub struct LimiterGuard<'a> { /* private fields */ }Expand description
RAII guard holding one slot in the limiter.
Drop the guard to release the slot. In the (unreachable) error case where the semaphore was closed, the guard holds no permit and dropping it is a no-op - the limiter cannot make a phantom permit do useful work, but the type stays total so callers do not have to handle a second error variant.
Trait Implementations§
Source§impl Drop for LimiterGuard<'_>
impl Drop for LimiterGuard<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LimiterGuard<'a>
impl<'a> !UnwindSafe for LimiterGuard<'a>
impl<'a> Freeze for LimiterGuard<'a>
impl<'a> Send for LimiterGuard<'a>
impl<'a> Sync for LimiterGuard<'a>
impl<'a> Unpin for LimiterGuard<'a>
impl<'a> UnsafeUnpin for LimiterGuard<'a>
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