pub enum MemoryMapOption {
Readable,
Writable,
Executable,
Addr(*const u8),
Fd(c_int),
Offset(usize),
NonStandardFlags(c_int),
}
Expand description
Options memory map created with.
Variants§
Readable
The memory should be readable.
Writable
The memory should be writable.
Executable
The memory should be executable.
Addr(*const u8)
Create a map for a specific address range. Corresponds to MAP_FIXED
on
POSIX.
Fd(c_int)
Create a memory mapping for a file with a given fd.
Offset(usize)
When using MapFd
, the start of the map is usize
bytes from the start
of the file.
NonStandardFlags(c_int)
On POSIX, this can be used to specify the default flags passed to
mmap
. By default it uses MAP_PRIVATE
and, if not using MapFd
,
MAP_ANON
. This will override both of those. This is platform-specific
(the exact values used) and ignored on Windows.
Trait Implementations§
Source§impl Clone for MemoryMapOption
impl Clone for MemoryMapOption
Source§fn clone(&self) -> MemoryMapOption
fn clone(&self) -> MemoryMapOption
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 moreimpl Copy for MemoryMapOption
Auto Trait Implementations§
impl Freeze for MemoryMapOption
impl RefUnwindSafe for MemoryMapOption
impl !Send for MemoryMapOption
impl !Sync for MemoryMapOption
impl Unpin for MemoryMapOption
impl UnwindSafe for MemoryMapOption
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