Struct mmap_fixed::MemoryMap
source · pub struct MemoryMap { /* private fields */ }
Expand description
A memory mapped file or chunk of memory. This is a very system-specific
interface to the OS’s memory mapping facilities (mmap
on POSIX,
VirtualAlloc
/CreateFileMapping
on Windows). It makes no attempt at
abstracting platform differences, besides in error values returned. Consider
yourself warned.
The memory map is released (unmapped) when the destructor is run, so don’t let it leave scope by accident if you want it to stick around.
Implementations§
source§impl MemoryMap
impl MemoryMap
sourcepub fn new(min_len: usize, options: &[MapOption]) -> Result<MemoryMap, MapError>
pub fn new(min_len: usize, options: &[MapOption]) -> Result<MemoryMap, MapError>
Create a new mapping with the given options
, at least min_len
bytes long.
sourcepub fn granularity() -> usize
pub fn granularity() -> usize
Granularity of MapAddr() and MapOffset() parameter values. This may be greater than the value returned by page_size().
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MemoryMap
impl !Send for MemoryMap
impl !Sync for MemoryMap
impl Unpin for MemoryMap
impl UnwindSafe for MemoryMap
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