aboutsummaryrefslogtreecommitdiff
path: root/database/src/indices/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-12-15 15:09:37 +0100
committermetamuffin <metamuffin@disroot.org>2025-12-15 15:09:37 +0100
commit0e48299889c3c2b81bf351ffe5da71e0bcd4c22a (patch)
tree8a7ff2bd2330c206070b2062723ba471b2d62544 /database/src/indices/mod.rs
parent7552a4ff0e027334398d28d5687a339ad77c0871 (diff)
downloadjellything-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.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
+ }
+}