Struct memmap2::MmapRaw [−][src]
pub struct MmapRaw { /* fields omitted */ }
Expand description
A handle to a raw memory mapped buffer.
This struct never hands out references to its interior, only raw pointers. This can be helpful when creating shared memory maps between untrusted processes.
Implementations
impl MmapRaw
[src]
impl MmapRaw
[src]pub fn map_raw(file: &File) -> Result<MmapRaw>
[src]
pub fn map_raw(file: &File) -> Result<MmapRaw>
[src]Creates a writeable memory map backed by a file.
This is equivalent to calling MmapOptions::new().map_raw(file)
.
Errors
This method returns an error when the underlying system call fails, which can happen for a variety of reasons, such as when the file is not open with read and write permissions.
pub fn as_ptr(&self) -> *const u8
[src]
pub fn as_ptr(&self) -> *const u8
[src]Returns a raw pointer to the memory mapped file.
Before dereferencing this pointer, you have to make sure that the file has not been truncated since the memory map was created. Avoiding this will not introduce memory safety issues in Rust terms, but will cause SIGBUS (or equivalent) signal.
pub fn as_mut_ptr(&self) -> *mut u8
[src]
pub fn as_mut_ptr(&self) -> *mut u8
[src]Returns an unsafe mutable pointer to the memory mapped file.
Before dereferencing this pointer, you have to make sure that the file has not been truncated since the memory map was created. Avoiding this will not introduce memory safety issues in Rust terms, but will cause SIGBUS (or equivalent) signal.