tyozo 0.1.0

in-memory key-value store
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub fn file_clear(path: &str) -> Result<(), std::io::Error> {
    std::fs::OpenOptions::new()
        .write(true)
        .truncate(true)
        .open(path)
        .map(|_| ())
}

pub fn open_or_create_file(path: &str) -> Result<std::fs::File, std::io::Error> {
    std::fs::OpenOptions::new()
        .append(true)
        .read(true)
        .create(true)
        .open(path)
}