diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-09 22:53:14 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-09 22:53:14 +0100 |
commit | c64d3cd8cda389909b4b3dbdf00c0710e2c9a490 (patch) | |
tree | c0c5f8a077d4ca0c627f3f50b5f6690b86909681 /src/database.rs | |
parent | 1599b61d22810e250f471b3b561660205297e07c (diff) | |
download | jellything-c64d3cd8cda389909b4b3dbdf00c0710e2c9a490.tar jellything-c64d3cd8cda389909b4b3dbdf00c0710e2c9a490.tar.bz2 jellything-c64d3cd8cda389909b4b3dbdf00c0710e2c9a490.tar.zst |
a
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 }) + } +} |