mmarinus
The mmarinus
crate wraps the underlying system mmap()
call in safe semantics.
For example:
use ;
let mut zero = open.unwrap;
let map = bytes
.near
.from
.with
.unwrap;
assert_eq!;
You can also remap an existing mapping:
use ;
let mut zero = open.unwrap;
let mut map = bytes
.anywhere
.from
.with
.unwrap;
assert_eq!;
let mut map = map.remap
.from
.with
.unwrap;
assert_eq!;
for i in map.iter_mut
assert_eq!;
Alternatively, you can just change the permissions:
use ;
let mut zero = open.unwrap;
let mut map = bytes
.at
.from
.with
.unwrap;
assert_eq!;
let mut map = map.reprotect.unwrap;
assert_eq!;
for i in map.iter_mut
assert_eq!;
Mapping a whole file into memory is easy:
use ;
let map = load.unwrap;
License: Apache-2.0