diff options
Diffstat (limited to 'src/database.rs')
-rw-r--r-- | src/database.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/database.rs b/src/database.rs new file mode 100644 index 0000000..51f7cb2 --- /dev/null +++ b/src/database.rs @@ -0,0 +1,13 @@ +use anyhow::Context; + +#[derive(Debug)] +pub struct Database { + 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 }) + } +} |