diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-27 20:56:20 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-27 20:56:20 +0100 |
| commit | 7930d543a2aa68d4ad2958605827d7eb1baa91f8 (patch) | |
| tree | fe59d1f549e303a96b78d3e925d75abb70b73af0 /database/src/lib.rs | |
| parent | c05bfcc2775f0e11db6e856bfcf06d0419c35d54 (diff) | |
| download | jellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar jellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar.bz2 jellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar.zst | |
reimplement Object as slice type
Diffstat (limited to 'database/src/lib.rs')
| -rw-r--r-- | database/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/database/src/lib.rs b/database/src/lib.rs index b8a67c9..263c2fc 100644 --- a/database/src/lib.rs +++ b/database/src/lib.rs @@ -3,15 +3,15 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin <metamuffin.org> */ -#![feature(if_let_guard)] +#![feature(phantom_variance_markers)] +pub mod helper; pub mod kv; pub mod query_syntax; #[cfg(test)] pub mod test_shared; -pub mod helper; use anyhow::Result; -use jellyobject::{ObjectBuffer, Path, Value}; +use jellyobject::{Object, Path, Value}; pub type RowNum = u64; pub type RowIter = Box<dyn Iterator<Item = Result<(RowNum, Vec<u8>)>>>; @@ -21,10 +21,10 @@ pub trait Database: Send + Sync { } pub trait Transaction { - fn insert(&mut self, entry: ObjectBuffer) -> Result<RowNum>; + fn insert(&mut self, entry: Box<Object>) -> Result<RowNum>; fn remove(&mut self, row: RowNum) -> Result<()>; - fn update(&mut self, row: RowNum, entry: ObjectBuffer) -> Result<()>; - fn get(&self, row: RowNum) -> Result<Option<ObjectBuffer>>; + fn update(&mut self, row: RowNum, entry: Box<Object>) -> Result<()>; + fn get(&self, row: RowNum) -> Result<Option<Box<Object>>>; fn query<'a>( &'a mut self, query: Query, |