pub struct Protection(/* private fields */);
Expand description
Represents memory protection flags.
This structure encapsulates read, write, and execute permissions for memory regions in a compact bit representation.
Implementations§
Source§impl Protection
impl Protection
Sourcepub const EXECUTE_BIT: u8 = 4u8
pub const EXECUTE_BIT: u8 = 4u8
Bit flag representing execute permission.
Sourcepub const READ_WRITE: Self
pub const READ_WRITE: Self
Read and write memory access.
Sourcepub const READ_EXECUTE: Self
pub const READ_EXECUTE: Self
Read and execute memory access.
Sourcepub const WRITE_EXECUTE: Self
pub const WRITE_EXECUTE: Self
Write and execute memory access.
Sourcepub const READ_WRITE_EXECUTE: Self
pub const READ_WRITE_EXECUTE: Self
Full memory access (read, write, and execute).
Sourcepub const fn set_execute(self, value: bool) -> Self
pub const fn set_execute(self, value: bool) -> Self
Sourcepub const fn get_write(&self) -> bool
pub const fn get_write(&self) -> bool
Checks if write permission is granted.
§Returns
true
if write permission is granted, false
otherwise.
Sourcepub const fn get_execute(&self) -> bool
pub const fn get_execute(&self) -> bool
Checks if execute permission is granted.
§Returns
true
if execute permission is granted, false
otherwise.
Trait Implementations§
Source§impl Clone for Protection
impl Clone for Protection
Source§fn clone(&self) -> Protection
fn clone(&self) -> Protection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Protection
impl Debug for Protection
Source§impl From<Protection> for u8
impl From<Protection> for u8
Source§fn from(protection: Protection) -> Self
fn from(protection: Protection) -> Self
Converts to this type from the input type.
Source§impl From<u8> for Protection
impl From<u8> for Protection
Source§impl PartialEq for Protection
impl PartialEq for Protection
impl Copy for Protection
impl Eq for Protection
impl StructuralPartialEq for Protection
Auto Trait Implementations§
impl Freeze for Protection
impl RefUnwindSafe for Protection
impl Send for Protection
impl Sync for Protection
impl Unpin for Protection
impl UnwindSafe for Protection
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