diff options
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> { |