aboutsummaryrefslogtreecommitdiff
path: root/src/storage
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-11-02 17:25:56 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-11-02 17:25:56 +0100
commit652da6efd35f198289ba3de26b60eb2e228de73a (patch)
treedd6fb40438e51370f0b6c91888f18a77adfe926b /src/storage
parentbf67935c54f5f66f4cab4ceb58c1b5831b9421b0 (diff)
downloadaerogramme-652da6efd35f198289ba3de26b60eb2e228de73a.tar.gz
aerogramme-652da6efd35f198289ba3de26b60eb2e228de73a.zip
converted incoming mail
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/mod.rs14
1 files changed, 9 insertions, 5 deletions
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<u8>),
}
type ConcurrentValues = Vec<Alternative>;
+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<Vec<RowValue>>;
}
pub type RowStore = Box<dyn IRowStore + Sync + Send>;
pub trait IRowRef
{
fn clone_boxed(&self) -> RowRef;
+ fn pk(&self) -> &str;
+ fn sk(&self) -> &str;
fn set_value(&self, content: Vec<u8>) -> RowValue;
fn fetch(&self) -> AsyncResult<RowValue>;
fn rm(&self) -> AsyncResult<()>;