diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-12-14 15:31:49 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-12-14 15:31:49 +0100 |
| commit | 7552a4ff0e027334398d28d5687a339ad77c0871 (patch) | |
| tree | af9d8c870febc8d852aa24b815fa85f43d26357d /database/src/backends/mod.rs | |
| parent | b20cecda65045635ae97d262e4a815dab1f52f55 (diff) | |
| download | jellything-7552a4ff0e027334398d28d5687a339ad77c0871.tar jellything-7552a4ff0e027334398d28d5687a339ad77c0871.tar.bz2 jellything-7552a4ff0e027334398d28d5687a339ad77c0871.tar.zst | |
new db backend
Diffstat (limited to 'database/src/backends/mod.rs')
| -rw-r--r-- | database/src/backends/mod.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/database/src/backends/mod.rs b/database/src/backends/mod.rs new file mode 100644 index 0000000..1240ac1 --- /dev/null +++ b/database/src/backends/mod.rs @@ -0,0 +1,18 @@ +/* + This file is part of jellything (https://codeberg.org/metamuffin/jellything) + which is licensed under the GNU Affero General Public License (version 3); see /COPYING. + Copyright (C) 2025 metamuffin <metamuffin.org> +*/ + +pub mod redb; +pub mod rocksdb; +pub mod memory; + +use anyhow::Result; + +pub trait DatabaseStorage { + fn set(&self, key: &[u8], value: &[u8]) -> Result<()>; + fn get<'a>(&'a self, key: &[u8]) -> Result<Option<Vec<u8>>>; + fn next(&self, key: &[u8]) -> Result<Option<Vec<u8>>>; + fn prev(&self, key: &[u8]) -> Result<Option<Vec<u8>>>; +} |