Skip to content

A lightweight rust library for manipulating memory maps

Notifications You must be signed in to change notification settings

TiagoMAntunes/easy_mmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

easy_mmap

Note: This crate is still in early development!

This library provides a simple to user interface to manipulate memory mapped memory by forcing the usage of Rust's strong typing system. It's a simple abstraction over the mmap crate.

It further abstracts the memory mapped region by also supporting iterators and easy local updates.

Example usage:

use easy_mmap::EasyMmapBuilder;
use mmap::MapOption;

fn main() {
    let map = &mut EasyMmapBuilder::<u32>::new()
        .capacity(10)
        .options(&[MapOption::MapReadable, MapOption::MapWritable])
        .build();

    map.iter_mut()
        .enumerate()
        .for_each(|(idx, x)| *x = idx as u32);

    map.iter().for_each(|v| {
        print!("{} ", v);
    });
}

About

A lightweight rust library for manipulating memory maps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages