pub struct SpinMutexGuard<'a, T: ?Sized + 'a> { /* private fields */ }
Expand description
An RAII implementation of a “scoped lock” of a SpinMutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
The data protected by the SpinMutex can be accessed through this guard via it’s [Deref'] and [
DerefMut`] implementations.
This structure is created by the lock
and try_lock
methods on SpinMutex
.
Borrowed largely from std’s MutexGuard
, but adapted to use spinlocks.
Trait Implementations§
source§impl<T: ?Sized> Deref for SpinMutexGuard<'_, T>
impl<T: ?Sized> Deref for SpinMutexGuard<'_, T>
source§impl<T: ?Sized> DerefMut for SpinMutexGuard<'_, T>
impl<T: ?Sized> DerefMut for SpinMutexGuard<'_, T>
source§impl<T: ?Sized> Drop for SpinMutexGuard<'_, T>
impl<T: ?Sized> Drop for SpinMutexGuard<'_, T>
impl<T: ?Sized + Sync> Sync for SpinMutexGuard<'_, T>
Mark as Sync if the contained data is sync.
Auto Trait Implementations§
impl<'a, T> Freeze for SpinMutexGuard<'a, T>where
T: ?Sized,
impl<'a, T> !RefUnwindSafe for SpinMutexGuard<'a, T>
impl<'a, T> Send for SpinMutexGuard<'a, T>
impl<'a, T> Unpin for SpinMutexGuard<'a, T>where
T: ?Sized,
impl<'a, T> !UnwindSafe for SpinMutexGuard<'a, 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