diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-12-15 15:09:37 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-12-15 15:09:37 +0100 |
| commit | 0e48299889c3c2b81bf351ffe5da71e0bcd4c22a (patch) | |
| tree | 8a7ff2bd2330c206070b2062723ba471b2d62544 /database/src/indices/mod.rs | |
| parent | 7552a4ff0e027334398d28d5687a339ad77c0871 (diff) | |
| download | jellything-0e48299889c3c2b81bf351ffe5da71e0bcd4c22a.tar jellything-0e48299889c3c2b81bf351ffe5da71e0bcd4c22a.tar.bz2 jellything-0e48299889c3c2b81bf351ffe5da71e0bcd4c22a.tar.zst | |
db
Diffstat (limited to 'database/src/indices/mod.rs')
| -rw-r--r-- | database/src/indices/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/database/src/indices/mod.rs b/database/src/indices/mod.rs new file mode 100644 index 0000000..48e91a9 --- /dev/null +++ b/database/src/indices/mod.rs @@ -0,0 +1,19 @@ +/* + 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> +*/ + +use crate::backends::KV; +use anyhow::Result; + +pub mod order; + +pub trait Index<T> { + fn add(&self, db: &dyn KV, id: u64, val: &T) -> Result<()>; + fn remove(&self, db: &dyn KV, id: u64, val: &T) -> Result<()>; + fn compare(&self, before: &T, after: &T) -> bool { + let _ = (before, after); + true + } +} |