From 0e48299889c3c2b81bf351ffe5da71e0bcd4c22a Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 15 Dec 2025 15:09:37 +0100 Subject: db --- database/src/indices/mod.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 database/src/indices/mod.rs (limited to 'database/src/indices/mod.rs') 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 +*/ + +use crate::backends::KV; +use anyhow::Result; + +pub mod order; + +pub trait Index { + 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 + } +} -- cgit v1.3