pub struct SpinLockGuard<'a, T: ?Sized, G: Guardian = IrqDisabled> {
lock: &'a SpinLock<T, G>,
state: ManuallyDrop<GuardianState<G::Token>>,
}Expand description
RAII guard that holds the lock and carries the guardian state.
Fields§
§lock: &'a SpinLock<T, G>§state: ManuallyDrop<GuardianState<G::Token>>Wrapped in ManuallyDrop so that Drop::drop can move it into
G::exit() without triggering a compiler-generated second drop of
the field.
Implementations§
Source§impl<'a, T: ?Sized> SpinLockGuard<'a, T, IrqDisabled>
impl<'a, T: ?Sized> SpinLockGuard<'a, T, IrqDisabled>
Sourcepub fn token(&self) -> &IrqDisabledToken
pub fn token(&self) -> &IrqDisabledToken
Return the typed proof that IRQs are disabled.
pub(crate) fn with_mut_and_token<R>( &mut self, f: impl FnOnce(&mut T, &IrqDisabledToken) -> R, ) -> R
Trait Implementations§
impl<T: ?Sized, G: Guardian> !Send for SpinLockGuard<'_, T, G>
Auto Trait Implementations§
impl<'a, T, G = IrqDisabled> !RefUnwindSafe for SpinLockGuard<'a, T, G>
impl<'a, T, G = IrqDisabled> !UnwindSafe for SpinLockGuard<'a, T, G>
impl<'a, T, G> Freeze for SpinLockGuard<'a, T, G>
impl<'a, T, G> Sync for SpinLockGuard<'a, T, G>
impl<'a, T, G> Unpin for SpinLockGuard<'a, T, G>
impl<'a, T, G> UnsafeUnpin for SpinLockGuard<'a, T, G>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more