Struct memmap::MmapViewSync
[−]
[src]
pub struct MmapViewSync { /* fields omitted */ }A thread-safe view of a memory map.
The view may be split into disjoint ranges, each of which will share the underlying memory map.
Methods
impl MmapViewSync[src]
pub fn split_at(self, offset: usize) -> Result<(MmapViewSync, MmapViewSync)>[src]
Split the view into disjoint pieces at the specified offset.
The provided offset must be less than the view's length.
pub fn restrict(&mut self, offset: usize, len: usize) -> Result<()>[src]
Restricts the range of this view to the provided offset and length.
The provided range must be a subset of the current range (offset + len < view.len()).
pub fn flush(&self) -> Result<()>[src]
Flushes outstanding view modifications to disk.
When this returns with a non-error result, all outstanding changes to a file-backed memory map view are guaranteed to be durably stored. The file's metadata (including last modification timestamp) may not be updated.
pub fn flush_async(&self) -> Result<()>[src]
Asynchronously flushes outstanding memory map view modifications to disk.
This method initiates flushing modified pages to durable storage, but it will not wait for the operation to complete before returning. The file's metadata (including last modification timestamp) may not be updated.
pub fn len(&self) -> usize[src]
Returns the length of the memory map view.
pub fn ptr(&self) -> *const u8[src]
Returns a shared pointer to the mapped memory.
See Mmap::as_slice for invariants that must hold when dereferencing the pointer.
pub fn mut_ptr(&mut self) -> *mut u8[src]
Returns a mutable pointer to the mapped memory.
See Mmap::as_mut_slice for invariants that must hold when dereferencing the pointer.
pub unsafe fn as_slice(&self) -> &[u8][src]
Returns the memory mapped file as an immutable slice.
Unsafety
The caller must ensure that the file is not concurrently modified.
pub unsafe fn as_mut_slice(&mut self) -> &mut [u8][src]
Returns the memory mapped file as a mutable slice.
Unsafety
The caller must ensure that the file is not concurrently accessed.
pub unsafe fn clone(&self) -> MmapViewSync[src]
Clones the view of the memory map.
The underlying memory map is shared, and thus the caller must ensure that the memory underlying the view is not illegally aliased.
Trait Implementations
impl Debug for MmapViewSync[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more