aboutsummaryrefslogtreecommitdiff
path: root/src/storage
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-11-17 15:02:43 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-11-17 15:02:43 +0100
commite92dc35564e91ce4e6a8defa9e8b52eef9e55fae (patch)
treebf33563e7858c5b8b6865c89558b2e0d305b3dec /src/storage
parent4a33ac2265dae0e8fd1f7fbaec54ab7120334cbe (diff)
downloadaerogramme-e92dc35564e91ce4e6a8defa9e8b52eef9e55fae.tar.gz
aerogramme-e92dc35564e91ce4e6a8defa9e8b52eef9e55fae.zip
fix orphan storage compatibility
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/garage.rs2
-rw-r--r--src/storage/in_memory.rs2
-rw-r--r--src/storage/mod.rs3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/storage/garage.rs b/src/storage/garage.rs
index f458aeb..00962f2 100644
--- a/src/storage/garage.rs
+++ b/src/storage/garage.rs
@@ -36,7 +36,7 @@ impl IRowStore for GrgStore {
unimplemented!();
}
- fn from_orphan(&self, orphan: OrphanRowRef) -> RowRef {
+ fn from_orphan(&self, orphan: OrphanRowRef) -> Result<RowRef, StorageError> {
unimplemented!();
}
}
diff --git a/src/storage/in_memory.rs b/src/storage/in_memory.rs
index 20f96a4..a29b790 100644
--- a/src/storage/in_memory.rs
+++ b/src/storage/in_memory.rs
@@ -37,7 +37,7 @@ impl IRowStore for MemStore {
unimplemented!();
}
- fn from_orphan(&self, orphan: OrphanRowRef) -> RowRef {
+ fn from_orphan(&self, orphan: OrphanRowRef) -> Result<RowRef, StorageError> {
unimplemented!();
}
}
diff --git a/src/storage/mod.rs b/src/storage/mod.rs
index 08ccfec..86d7fa2 100644
--- a/src/storage/mod.rs
+++ b/src/storage/mod.rs
@@ -36,6 +36,7 @@ pub enum Selector<'a> {
pub enum StorageError {
NotFound,
Internal,
+ IncompatibleOrphan,
}
impl std::fmt::Display for StorageError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
@@ -87,7 +88,7 @@ pub trait IRowStore
fn row(&self, partition: &str, sort: &str) -> RowRef;
fn select(&self, selector: Selector) -> AsyncResult<Vec<RowValue>>;
fn rm(&self, selector: Selector) -> AsyncResult<()>;
- fn from_orphan(&self, orphan: OrphanRowRef) -> RowRef;
+ fn from_orphan(&self, orphan: OrphanRowRef) -> Result<RowRef, StorageError>;
}
pub type RowStore = Box<dyn IRowStore + Sync + Send>;