pub struct LocalInterruptDisabled(/* private fields */);Expand description
A guard that represents local processor interrupt disablement on preemptible kernels.
LocalInterruptDisabled is a guard type that represents that local processor interrupts have
been disabled on a preemptible kernel.
Certain functions take an immutable reference of LocalInterruptDisabled in order to require
that they may only be run in local-interrupt-disabled contexts on preemptible kernels.
This is a marker type; it has no size, and is simply used as a compile-time guarantee that local processor interrupts are disabled on preemptible kernels. Note that no guarantees about the state of interrupts are made by this type on non-preemptible kernels.
§Invariants
Local processor interrupts are disabled on preemptible kernels for as long as an object of this type exists.
Implementations§
Source§impl LocalInterruptDisabled
impl LocalInterruptDisabled
Sourcepub unsafe fn assume_disabled<'a>() -> &'a LocalInterruptDisabled
pub unsafe fn assume_disabled<'a>() -> &'a LocalInterruptDisabled
Assume that local processor interrupts are disabled on preemptible kernels.
This can be used for annotating code that is known to be run in contexts where local processor interrupts are disabled on preemptible kernels. It makes no changes to the local interrupt state on its own.
§Safety
For the whole life 'a, local interrupts must be disabled on preemptible kernels. This
could be a context like, for example, an interrupt handler.
Trait Implementations§
Source§impl Drop for LocalInterruptDisabled
impl Drop for LocalInterruptDisabled
Auto Trait Implementations§
impl !Send for LocalInterruptDisabled
impl !Sync for LocalInterruptDisabled
impl Freeze for LocalInterruptDisabled
impl RefUnwindSafe for LocalInterruptDisabled
impl Unpin for LocalInterruptDisabled
impl UnsafeUnpin for LocalInterruptDisabled
impl UnwindSafe for LocalInterruptDisabled
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Source§fn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
self into a T. This operation is guaranteed to be lossless.Source§impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
Source§fn into_safe_cast_arch(self) -> T
fn into_safe_cast_arch(self) -> T
self into a T. This operation is guaranteed to be lossless.