Struct cros_async::sync::spin::SpinLockGuard
source · pub struct SpinLockGuard<'a, T: 'a + ?Sized> {
lock: &'a SpinLock<T>,
value: &'a mut T,
}
Expand description
An RAII implementation of a “scoped lock” for a SpinLock
. When this structure is dropped, the
lock will be released. The resource protected by the SpinLock
can be accessed via the Deref
and DerefMut
implementations of this structure.
Fields§
§lock: &'a SpinLock<T>
§value: &'a mut T
Trait Implementations§
source§impl<'a, T: ?Sized> Deref for SpinLockGuard<'a, T>
impl<'a, T: ?Sized> Deref for SpinLockGuard<'a, T>
source§impl<'a, T: ?Sized> DerefMut for SpinLockGuard<'a, T>
impl<'a, T: ?Sized> DerefMut for SpinLockGuard<'a, T>
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for SpinLockGuard<'a, T>
impl<'a, T: ?Sized> Send for SpinLockGuard<'a, T>where
T: Send,
impl<'a, T: ?Sized> Sync for SpinLockGuard<'a, T>
impl<'a, T: ?Sized> Unpin for SpinLockGuard<'a, T>
impl<'a, T> !UnwindSafe for SpinLockGuard<'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