diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-11-01 17:18:58 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-11-01 17:18:58 +0100 |
commit | cf8b9ac28d6813bd589f363ad3659dd215bd7cea (patch) | |
tree | 3c567dafe8f7ac156cc62358df6befeca26655ce /src/storage/mod.rs | |
parent | 8ac3a8ce8ba268a3261e23694b8b62afa6a3ae37 (diff) | |
download | aerogramme-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.rs | 20 |
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> { |