aboutsummaryrefslogtreecommitdiff
path: root/database/src/indices/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'database/src/indices/mod.rs')
-rw-r--r--database/src/indices/mod.rs19
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
+ }
+}