aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-11-01 09:25:09 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-11-01 09:25:09 +0100
commitc3bb2b62a862c09d52226a82a032061676a0cb77 (patch)
tree47b83bdf79a671069d61a6bafd5cc94e1137dd43 /src
parent95685ba9a75df0f00458b8260fb87bae82e0dfa3 (diff)
downloadaerogramme-c3bb2b62a862c09d52226a82a032061676a0cb77.tar.gz
aerogramme-c3bb2b62a862c09d52226a82a032061676a0cb77.zip
rework interface
Diffstat (limited to 'src')
-rw-r--r--src/storage/mod.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/storage/mod.rs b/src/storage/mod.rs
index 1a77a55..6b410a2 100644
--- a/src/storage/mod.rs
+++ b/src/storage/mod.rs
@@ -32,12 +32,15 @@ pub enum Error {
Internal,
}
-// ------ Rows
+// ------ Store
pub trait RowStore {
- fn new_ref(partition: &str, sort: &str) -> impl RowRef;
- fn new_ref_batch(partition: &str, filter: Selector) -> impl RowRefBatch;
+ fn new_row(&self, partition: &str, sort: &str) -> impl RowRef;
+ fn new_row_batch(&self, partition: &str, filter: Selector) -> impl RowRefBatch;
+ fn new_blob(&self, key: &str) -> impl BlobRef;
+ fn new_blob_list(&self) -> Vec<impl BlobRef>;
}
+// ------- Row
pub trait RowRef {
fn to_value(&self, content: &[u8]) -> impl RowValue;
async fn get(&self) -> Result<impl RowValue, Error>;
@@ -66,11 +69,6 @@ pub trait RowValueBatch {
}
// ----- Blobs
-pub trait BlobStore {
- fn new_ref(key: &str) -> impl BlobRef;
- async fn list(&self) -> ();
-}
-
pub trait BlobRef {
fn set_value(&self, content: &[u8]) -> impl BlobValue;
async fn get(&self) -> impl BlobValue;