8 releases
0.1.9 | Aug 15, 2022 |
---|---|
0.1.8 | Aug 13, 2022 |
#1025 in Filesystem
27 downloads per month
15KB
191 lines
easy_safe
An easy unstable crate to save strings into a map that is saved on the disk.
The normal map_env creates a new map environment with the specified name. The name corresponds to the file saved and loaded in your filesystem. If the file is already there it will load from that file.
This means you can always come back and access your file if you call it with the right name
Example
use easy_safe::{create_or_load_map_env, MapEnv};
let mut map_env: MapEnv = create_or_load_map_env("somename");
map_env.put("somekey", "somevalue");
let value = map_env.get("somekey").unwrap();
assert_eq!(value, "somevalue");
let mut same_file_map_env: MapEnv = create_or_load_map_env("somename");
let also_the_value = same_file_map_env.get("somekey").unwrap();
assert_eq!(value, "somevalue");
Dependencies
~0.7–1.6MB
~35K SLoC