Struct base::mmap::Protection
source · pub struct Protection {
pub(crate) read: bool,
pub(crate) write: bool,
}
Expand description
Memory access type for anonymous shared memory mapping.
Fields§
§read: bool
§write: bool
Implementations§
source§impl Protection
impl Protection
sourcepub fn read_write() -> Protection
pub fn read_write() -> Protection
Returns Protection allowing read/write access.
sourcepub fn read() -> Protection
pub fn read() -> Protection
Returns Protection allowing read access.
sourcepub fn write() -> Protection
pub fn write() -> Protection
Returns Protection allowing write access.
sourcepub fn set_read(self) -> Protection
pub fn set_read(self) -> Protection
Set read events.
sourcepub fn set_write(self) -> Protection
pub fn set_write(self) -> Protection
Set write events.
sourcepub fn allows(&self, other: &Protection) -> bool
pub fn allows(&self, other: &Protection) -> bool
Returns true if all access allowed by |other| is also allowed by |self|.
Trait Implementations§
source§impl Clone for Protection
impl Clone for Protection
source§fn clone(&self) -> Protection
fn clone(&self) -> Protection
Returns a copy 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 Default for Protection
impl Default for Protection
source§fn default() -> Protection
fn default() -> Protection
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Protection
impl<'de> Deserialize<'de> for Protection
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Protection> for c_int
impl From<Protection> for c_int
source§fn from(p: Protection) -> Self
fn from(p: Protection) -> Self
Converts to this type from the input type.
source§impl PartialEq for Protection
impl PartialEq for Protection
source§fn eq(&self, other: &Protection) -> bool
fn eq(&self, other: &Protection) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Protection
impl Serialize for Protection
impl Copy for Protection
impl Eq for Protection
impl StructuralPartialEq for Protection
Auto Trait Implementations§
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