pub struct SemaphoreGuard<T> { /* private fields */ }
Expand description
RAII guard used to release access to the semaphore automatically when it falls out of scope.
Returned from Semaphore::try_access
.
§Sharing guards
There are cases where, once acquired, you want to share a guard between multiple threads
of execution. This pattern can be implemented by wrapping the acquired guard into an Rc
or Arc
reference.
Trait Implementations§
Source§impl<T: Sized> Deref for SemaphoreGuard<T>
impl<T: Sized> Deref for SemaphoreGuard<T>
Auto Trait Implementations§
impl<T> Freeze for SemaphoreGuard<T>
impl<T> !RefUnwindSafe for SemaphoreGuard<T>
impl<T> Send for SemaphoreGuard<T>
impl<T> Sync for SemaphoreGuard<T>
impl<T> Unpin for SemaphoreGuard<T>
impl<T> !UnwindSafe for SemaphoreGuard<T>
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