aboutsummaryrefslogtreecommitdiff
path: root/database/src/prefix_iterator.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-05 20:31:55 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-05 20:31:55 +0100
commit65ca3f3450d0067668111f6e13cc3089768c9efe (patch)
tree89dceed4f711d25ff2763e18a4be7e1a59e79507 /database/src/prefix_iterator.rs
parent1af0468788c0a592a76398206e6c7479384853ec (diff)
downloadjellything-65ca3f3450d0067668111f6e13cc3089768c9efe.tar
jellything-65ca3f3450d0067668111f6e13cc3089768c9efe.tar.bz2
jellything-65ca3f3450d0067668111f6e13cc3089768c9efe.tar.zst
remove read/write distinction for kv transactions; traitify database
Diffstat (limited to 'database/src/prefix_iterator.rs')
-rw-r--r--database/src/prefix_iterator.rs22
1 files changed, 0 insertions, 22 deletions
diff --git a/database/src/prefix_iterator.rs b/database/src/prefix_iterator.rs
deleted file mode 100644
index 9a73558..0000000
--- a/database/src/prefix_iterator.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- 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 anyhow::Result;
-use std::borrow::Cow;
-
-pub struct PrefixIterator<'a> {
- pub inner: Box<dyn Iterator<Item = Result<Vec<u8>>> + 'a>,
- pub prefix: Cow<'a, [u8]>,
-}
-impl Iterator for PrefixIterator<'_> {
- type Item = Result<Vec<u8>>;
- fn next(&mut self) -> Option<Self::Item> {
- self.inner.next().filter(|k| match k {
- Ok(v) => v.starts_with(&self.prefix),
- Err(_) => true,
- })
- }
-}