Rust based Sled Key-Value store db as Key-Structured Value Wrapper
[dependencies]
serde = { version = "1.0.188", features = ["derive"] }
sled_json = { git = "https://github.com/Walker-00/sled_json" }
use serde::{Serialize, Deserialize};
use sled_json::JsonDb;
#[derive(Serialize, Deserialize, Debug)]
struct Info {
name: String,
age: u8,
}
fn main() {
let linus_walker = Info {
name: "Linus Walker".into(),
age: 14,
};
let db = JsonDb::open("db").unwrap();
db.insert("linus_walker", &linus_walker).unwrap();
let resul = db.get::<Info>(&"linus_walker".to_string()).unwrap();
println!("{resul:?}");
}