aboutsummaryrefslogtreecommitdiff
path: root/src/storage/mod.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-11-01 17:18:58 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-11-01 17:18:58 +0100
commitcf8b9ac28d6813bd589f363ad3659dd215bd7cea (patch)
tree3c567dafe8f7ac156cc62358df6befeca26655ce /src/storage/mod.rs
parent8ac3a8ce8ba268a3261e23694b8b62afa6a3ae37 (diff)
downloadaerogramme-cf8b9ac28d6813bd589f363ad3659dd215bd7cea.tar.gz
aerogramme-cf8b9ac28d6813bd589f363ad3659dd215bd7cea.zip
mask implementation to the rest of the code
Diffstat (limited to 'src/storage/mod.rs')
-rw-r--r--src/storage/mod.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/storage/mod.rs b/src/storage/mod.rs
index 2e4f757..c0835e6 100644
--- a/src/storage/mod.rs
+++ b/src/storage/mod.rs
@@ -29,12 +29,30 @@ pub enum Error {
}
pub trait Sto: Sized {
- type Builder: RowStore<Self>;
+ type Builder: RowBuilder<Self>;
type Store: RowStore<Self>;
type Ref: RowRef<Self>;
type Value: RowValue<Self>;
}
+pub struct Engine<T: Sto> {
+ bucket: String,
+ row: T::Builder,
+}
+
+pub enum AnyEngine {
+ InMemory(Engine<in_memory::MemTypes>),
+ Garage(Engine<garage::GrgTypes>),
+}
+impl AnyEngine {
+ fn engine<X: Sto>(&self) -> &Engine<X> {
+ match self {
+ Self::InMemory(x) => x,
+ Self::Garage(x) => x,
+ }
+ }
+}
+
// ------ Row Builder
pub trait RowBuilder<R: Sto>
{