diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-12-18 18:45:53 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-12-18 18:45:53 +0100 |
| commit | da985cc06e4caa7501222dbf54f212536fd42b0c (patch) | |
| tree | 106ebacb66abb8fd97a7be4e802ac45d8ce9852d /database/src/indices/order.rs | |
| parent | fc7f3ae8e39a0398ceba7b9c44f58679c01a98da (diff) | |
| download | jellything-da985cc06e4caa7501222dbf54f212536fd42b0c.tar jellything-da985cc06e4caa7501222dbf54f212536fd42b0c.tar.bz2 jellything-da985cc06e4caa7501222dbf54f212536fd42b0c.tar.zst | |
transaction interface
Diffstat (limited to 'database/src/indices/order.rs')
| -rw-r--r-- | database/src/indices/order.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/database/src/indices/order.rs b/database/src/indices/order.rs index 04fb975..5b7924b 100644 --- a/database/src/indices/order.rs +++ b/database/src/indices/order.rs @@ -4,7 +4,7 @@ Copyright (C) 2025 metamuffin <metamuffin.org> */ -use crate::{backends::KV, indices::Index, table::Table}; +use crate::{backends::WriteTransaction, indices::Index, table::Table}; use anyhow::Result; pub struct OrderIndex<T> { @@ -25,11 +25,11 @@ impl<T: 'static> OrderIndex<T> { } } impl<T: 'static> Index<T> for OrderIndex<T> { - fn add(&self, db: &dyn KV, id: u64, val: &T) -> Result<()> { + fn add(&self, db: &mut dyn WriteTransaction, id: u64, val: &T) -> Result<()> { db.set(&self.key(id, val), &[])?; Ok(()) } - fn remove(&self, db: &dyn KV, id: u64, val: &T) -> Result<()> { + fn remove(&self, db: &mut dyn WriteTransaction, id: u64, val: &T) -> Result<()> { db.del(&self.key(id, val))?; Ok(()) } |