diff options
Diffstat (limited to 'database/src/sort/mod.rs')
| -rw-r--r-- | database/src/sort/mod.rs | 22 |
1 files changed, 22 insertions, 0 deletions
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 <metamuffin.org> +*/ + +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 + } +} |