Crates.io PRs Welcome Crates.io Crates.io

Library uses file-based mmap to store key-values

This is a simple rust version of mmkv, only part of the core features have been implemented so far, and it is still far from production availability.

How to use

Add dependency: toml [dependencies] mmkv = { version = "0.1.0" } And use MMKV directly: ```rust use mmkv::MMKV;

fn main() { // initialize it with a directory, // the library will crate a file, // named "minimmkv" under this dir MMKV::initialize("."); MMKV::puti32("key1", 1); // Some(1) println!("{:?}", MMKV::geti32("key1")); MMKV::putstr("key1", "value"); // None, cause "key1" was override by putstr println!("{:?}", MMKV::geti32("key1")); // Some("value") println!("{:?}", MMKV::getstr("key1")); MMKV::putbool("key1", true); // Some(true) println!("{:?}", MMKV::get_bool("key1")); } ```