Struct wasmtime_runtime::mpk::ProtectionMask
source · pub struct ProtectionMask(/* private fields */);
Expand description
A bit field indicating which protection keys should be allowed and disabled.
The internal representation makes it easy to use ProtectionMask
directly
with the PKRU register. When bits n
and n+1
are set, it means the
protection key is not allowed (see the PKRU write and access disabled
bits).
Implementations§
source§impl ProtectionMask
impl ProtectionMask
sourcepub fn zero() -> Self
pub fn zero() -> Self
Only allow access to memory protected with protection key 0; note that this does not mean “none” but rather allows access from the default kernel protection key.
sourcepub fn or(self, pkey: ProtectionKey) -> Self
pub fn or(self, pkey: ProtectionKey) -> Self
Include pkey
as another allowed protection key in the mask.
Auto Trait Implementations§
impl Freeze for ProtectionMask
impl RefUnwindSafe for ProtectionMask
impl Send for ProtectionMask
impl Sync for ProtectionMask
impl Unpin for ProtectionMask
impl UnwindSafe for ProtectionMask
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