diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-15 02:57:31 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-15 02:57:31 +0100 |
| commit | c836b650eaf4ba33b1cfd2b475971b3ccc9f69b7 (patch) | |
| tree | 2ea722aff33252ff2e3662faee63cabb223339c3 /database/src/backends/redb.rs | |
| parent | 8c0ee6d17fe0dbd7748e7b60ff01a0e8f25faa51 (diff) | |
| download | jellything-c836b650eaf4ba33b1cfd2b475971b3ccc9f69b7.tar jellything-c836b650eaf4ba33b1cfd2b475971b3ccc9f69b7.tar.bz2 jellything-c836b650eaf4ba33b1cfd2b475971b3ccc9f69b7.tar.zst | |
new update_node_init
Diffstat (limited to 'database/src/backends/redb.rs')
| -rw-r--r-- | database/src/backends/redb.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/database/src/backends/redb.rs b/database/src/backends/redb.rs index 70623b5..c0887c8 100644 --- a/database/src/backends/redb.rs +++ b/database/src/backends/redb.rs @@ -4,9 +4,7 @@ Copyright (C) 2026 metamuffin <metamuffin.org> */ -use crate::backends::{ - Database, ReadTransaction, ReadTxnFunction, WriteTransaction, WriteTxnFunction, -}; +use crate::backends::{Database, ReadTransaction, WriteTransaction}; use anyhow::Result; use redb::{AccessGuard, ReadableDatabase, ReadableTable, StorageError, Table, TableDefinition}; use std::path::Path; @@ -18,7 +16,10 @@ pub fn new(path: &Path) -> Result<redb::Database> { } impl Database for redb::Database { - fn write_transaction(&self, f: &mut WriteTxnFunction) -> Result<()> { + fn write_transaction( + &self, + f: &mut dyn FnMut(&mut dyn WriteTransaction) -> Result<()>, + ) -> Result<()> { let txn = self.begin_write()?; let mut table = txn.open_table(TABLE)?; f(&mut table)?; @@ -26,7 +27,10 @@ impl Database for redb::Database { txn.commit()?; Ok(()) } - fn read_transaction(&self, f: &mut ReadTxnFunction) -> Result<()> { + fn read_transaction( + &self, + f: &mut dyn FnMut(&dyn ReadTransaction) -> Result<()>, + ) -> Result<()> { let mut txn = self.begin_read()?; f(&mut txn)?; Ok(()) |