pub struct UserAccessGuard {
_private: (),
}Expand description
RAII guard that disables Supervisor Mode Access Prevention (SMAP) on creation and re-enables it on drop. Ensures AC is restored on all code paths including panics and early returns.
§Usage
ⓘ
let _guard = UserAccessGuard::new();
// ... access user memory safely ...
// AC is re-enabled when _guard is dropped.Fields§
§_private: ()Implementations§
Trait Implementations§
impl !Send for UserAccessGuard
impl !Sync for UserAccessGuard
Source§impl Drop for UserAccessGuard
impl Drop for UserAccessGuard
Auto Trait Implementations§
impl Freeze for UserAccessGuard
impl RefUnwindSafe for UserAccessGuard
impl Unpin for UserAccessGuard
impl UnsafeUnpin for UserAccessGuard
impl UnwindSafe for UserAccessGuard
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