From abf25f340c11111369b69c13c34d8fed9d4f0da8 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 14 Jan 2026 20:28:54 +0100 Subject: db binning and sorts --- database/src/sort/mod.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 database/src/sort/mod.rs (limited to 'database/src/sort/mod.rs') diff --git a/database/src/sort/mod.rs b/database/src/sort/mod.rs new file mode 100644 index 0000000..6473f5d --- /dev/null +++ b/database/src/sort/mod.rs @@ -0,0 +1,22 @@ +/* + 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) 2026 metamuffin +*/ + +use crate::{backends::WriteTransaction, table::RowNum}; +use anyhow::Result; +use jellycommon::jellyobject::Object; + +pub mod none; +pub mod value; + +pub trait Index { + fn add(&self, db: &mut dyn WriteTransaction, row: RowNum, val: Object) -> Result<()>; + fn remove(&self, db: &mut dyn WriteTransaction, row: RowNum, val: Object) -> Result<()>; + /// Might return true if objects are identical for this index; false if not or uncertain + fn compare(&self, before: Object, after: Object) -> bool { + let _ = (before, after); + false + } +} -- cgit v1.3