cached_db 0.2.2

A NoSQL database with a built in cache layer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use bson::{doc, Bson, Document};
use std::fs::{create_dir, File};
use std::io::{Read, Write};
use std::path::Path;

pub fn ensure_folder(path: &String) {
    if Path::new(path).exists() {
        if !Path::new(path).is_dir() {
            println!("{} is not a directory", path);
            return;
        }
    } else {
        create_dir(path).unwrap();
    }
}