diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-14 20:28:54 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-14 20:28:54 +0100 |
| commit | abf25f340c11111369b69c13c34d8fed9d4f0da8 (patch) | |
| tree | 1e913a4affe3303a17a222c8215a51424d3b71b6 /database/src/sort/mod.rs | |
| parent | b5ff460e938779be4eeab292c2cc1d436b93c137 (diff) | |
| download | jellything-abf25f340c11111369b69c13c34d8fed9d4f0da8.tar jellything-abf25f340c11111369b69c13c34d8fed9d4f0da8.tar.bz2 jellything-abf25f340c11111369b69c13c34d8fed9d4f0da8.tar.zst | |
db binning and sorts
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 + } +} |