pub struct PreemptDisabled;Expand description
Guardian that only disables preemption, leaving IRQs untouched.
Use this for per-CPU data that is never accessed from interrupt handlers.
Cheaper than IrqDisabled because it avoids a RFLAGS read/write.
Trait Implementations§
Source§impl Guardian for PreemptDisabled
impl Guardian for PreemptDisabled
Source§type Token = PreemptGuard
type Token = PreemptGuard
Token type that proves the CPU is in the right protection mode.
Source§fn enter() -> GuardianState<Self::Token>
fn enter() -> GuardianState<Self::Token>
Enter the protected mode and return the token.
Source§fn exit(_state: GuardianState<Self::Token>)
fn exit(_state: GuardianState<Self::Token>)
Exit the protected mode, restoring the previous CPU state.
Auto Trait Implementations§
impl Freeze for PreemptDisabled
impl RefUnwindSafe for PreemptDisabled
impl Send for PreemptDisabled
impl Sync for PreemptDisabled
impl Unpin for PreemptDisabled
impl UnsafeUnpin for PreemptDisabled
impl UnwindSafe for PreemptDisabled
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
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