From 652da6efd35f198289ba3de26b60eb2e228de73a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 2 Nov 2023 17:25:56 +0100 Subject: converted incoming mail --- src/storage/mod.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/storage/mod.rs') diff --git a/src/storage/mod.rs b/src/storage/mod.rs index c5ed1f8..b687959 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -14,17 +14,18 @@ use futures::future::BoxFuture; pub mod in_memory; pub mod garage; -pub enum Selector<'a> { - Range{ begin: &'a str, end: &'a str }, - Filter(u64), -} - pub enum Alternative { Tombstone, Value(Vec), } type ConcurrentValues = Vec; +pub enum Selector<'a> { + Range { begin: &'a str, end: &'a str }, + List (Vec<(&'a str, &'a str)>), + Prefix (&'a str), +} + #[derive(Debug)] pub enum StorageError { NotFound, @@ -78,12 +79,15 @@ impl Hash for Builders { pub trait IRowStore { fn row(&self, partition: &str, sort: &str) -> RowRef; + fn select(&self, selector: Selector) -> AsyncResult>; } pub type RowStore = Box; pub trait IRowRef { fn clone_boxed(&self) -> RowRef; + fn pk(&self) -> &str; + fn sk(&self) -> &str; fn set_value(&self, content: Vec) -> RowValue; fn fetch(&self) -> AsyncResult; fn rm(&self) -> AsyncResult<()>; -- cgit v1.2.3