The design of this crate is inspired by Dgraph's mmap file implementation in Stretto.
All of file-backed memory map has the potential for Undefined Behavior (UB) if the underlying file is subsequently modified (e.g. the file is deleted by another process), in or out of process, this crate tries to avoid this situation by provide file lock APIs.
This crate supports std and popular async runtime(tokio, async-std, smol), and thanks to macro
in Rust, it is super easy to support any new async runtime. For details, please see the implementation for tokio, async-std, smol of the source code.
MAP_STACK
on unix)std
toml
[dependencies]
fmmap = 0.2
tokio
toml
[dependencies]
fmmap = { version = "0.3", features = ["tokio-async"] }
async-std
toml
[dependencies]
fmmap = { version = "0.3", features = ["std-async"] }
smol
toml
[dependencies]
fmmap = { version = "0.3", features = ["smol-async"] }
This crate is 100% documented, see documents for examples.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.