1 2 3 4 5 6 7 8 9 10 11 12 13
use anyhow::Context; #[derive(Debug)] pub struct Database { pub db: sled::Db, } impl Database { pub fn open(path: &str) -> Result<Self, anyhow::Error> { let db = sled::open(path).context("opening database")?; Ok(Self { db }) } }