pub struct MemoryMap<T> { /* private fields */ }
Expand description
Memory mapped IO
Implementations§
Source§impl<T> MemoryMap<T>
impl<T> MemoryMap<T>
Sourcepub fn read_and_write<F: FnOnce(T) -> T>(&mut self, cb: F)
pub fn read_and_write<F: FnOnce(T) -> T>(&mut self, cb: F)
Gives callback to accept value to return modified value to write.
Sourcepub fn as_ref<'a>(&'a mut self) -> RawPtr<'a, T>
pub fn as_ref<'a>(&'a mut self) -> RawPtr<'a, T>
Access raw pointer
Note that, ownership is not transferred
Sourcepub unsafe fn open_file_raw(
offset: off_t,
fd: c_int,
prot: c_int,
flags: c_int,
) -> Option<Self>
pub unsafe fn open_file_raw( offset: off_t, fd: c_int, prot: c_int, flags: c_int, ) -> Option<Self>
Opens memory map.
§Arguments
offset
- Offset within memory to start.fd
- File description. -1 for anonymous.prot
- Memory protection. Specifies operations to be expected. At the very least must bePROT_READ | PROT_WRITE
flags
- Specifies whether changes to the mapping are visible across forks. Must beMAP_ANON
for anonymous.
Trait Implementations§
impl<T> Send for MemoryMap<T>
impl<T> Sync for MemoryMap<T>
Auto Trait Implementations§
impl<T> Freeze for MemoryMap<T>
impl<T> RefUnwindSafe for MemoryMap<T>where
T: RefUnwindSafe,
impl<T> Unpin for MemoryMap<T>
impl<T> UnwindSafe for MemoryMap<T>where
T: RefUnwindSafe,
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