#[non_exhaustive]pub struct ProtectFlags {
pub read: bool,
pub write: bool,
pub exec: bool,
}Expand description
Memory protection bits passed to OsBacked::protect.
#[non_exhaustive] so future hardware-protection primitives can
add bits (PROT_MTE tag enable, MPK key index, PROT_GROWSDOWN) without
breaking downstream callers. Construct via the provided
NONE / RW / READ /
RX constants — never with a struct literal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.read: boolRegion is readable.
write: boolRegion is writable.
exec: boolRegion is executable.
Implementations§
Source§impl ProtectFlags
impl ProtectFlags
Sourcepub const NONE: ProtectFlags
pub const NONE: ProtectFlags
No access. Reads and writes fault.
Sourcepub const RW: ProtectFlags
pub const RW: ProtectFlags
Read + write, no execute. The standard data-region setting.
Sourcepub const READ: ProtectFlags
pub const READ: ProtectFlags
Read only.
Sourcepub const RX: ProtectFlags
pub const RX: ProtectFlags
Read + execute, no write. The standard code-region setting.
Trait Implementations§
Source§impl Clone for ProtectFlags
impl Clone for ProtectFlags
Source§fn clone(&self) -> ProtectFlags
fn clone(&self) -> ProtectFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProtectFlags
Source§impl Debug for ProtectFlags
impl Debug for ProtectFlags
impl Eq for ProtectFlags
Source§impl PartialEq for ProtectFlags
impl PartialEq for ProtectFlags
Source§fn eq(&self, other: &ProtectFlags) -> bool
fn eq(&self, other: &ProtectFlags) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProtectFlags
Auto Trait Implementations§
impl Freeze for ProtectFlags
impl RefUnwindSafe for ProtectFlags
impl Send for ProtectFlags
impl Sync for ProtectFlags
impl Unpin for ProtectFlags
impl UnsafeUnpin for ProtectFlags
impl UnwindSafe for ProtectFlags
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