pub struct CompositeStorage {
    pub storages: HashMap<String, Box<dyn IStorage>>,
    pub default_engine: Option<String>,
}

Fields§

§storages: HashMap<String, Box<dyn IStorage>>§default_engine: Option<String>

Implementations§

source§

impl CompositeStorage

source

pub fn new() -> CompositeStorage

source

pub fn set_default<T>(&mut self, default_engine: T)where T: Into<String>,

source

pub fn remove_default(&mut self)

source

pub fn push<T, U>(&mut self, engine: T, storage: U)where T: Into<String>, U: IStorage + 'static,

source

pub fn remove<T>(&mut self, engine: T) -> Option<Box<dyn IStorage>>where T: AsRef<str>,

source

pub fn clear(&mut self)

Trait Implementations§

source§

impl AlterTable for CompositeStorage

source§

fn rename_schema<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _table_name: &'life1 str, _new_table_name: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

source§

fn rename_column<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, _table_name: &'life1 str, _old_column_name: &'life2 str, _new_column_name: &'life3 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

source§

fn add_column<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _table_name: &'life1 str, _column_def: &'life2 ColumnDef ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

source§

fn drop_column<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _table_name: &'life1 str, _column_name: &'life2 str, _if_exists: bool ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

source§

impl CustomFunction for CompositeStorage

source§

fn fetch_function<'life0, 'life1, 'async_trait>( &'life0 self, _func_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Option<&'life0 CustomFunction>, Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

fn fetch_all_functions<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<&'life0 CustomFunction>, Error>> + 'async_trait>>where 'life0: 'async_trait, Self: 'async_trait,

source§

impl CustomFunctionMut for CompositeStorage

source§

fn insert_function<'life0, 'async_trait>( &'life0 mut self, _func: CustomFunction ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, Self: 'async_trait,

source§

fn delete_function<'life0, 'life1, 'async_trait>( &'life0 mut self, _func_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

source§

impl Default for CompositeStorage

source§

fn default() -> CompositeStorage

Returns the “default value” for a type. Read more
source§

impl Index for CompositeStorage

source§

fn scan_indexed_data<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _table_name: &'life1 str, _index_name: &'life2 str, _asc: Option<bool>, _cmp_value: Option<(&'life3 IndexOperator, Value)> ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<(Key, DataRow), Error>>>>, Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

source§

impl IndexMut for CompositeStorage

source§

fn create_index<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, _table_name: &'life1 str, _index_name: &'life2 str, _column: &'life3 OrderByExpr ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

source§

fn drop_index<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _table_name: &'life1 str, _index_name: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

source§

impl Metadata for CompositeStorage

source§

fn scan_table_meta<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Result<(String, HashMap<String, Value>), Error>>>, Error>> + 'async_trait>>where 'life0: 'async_trait, Self: 'async_trait,

source§

impl Store for CompositeStorage

source§

fn fetch_all_schemas<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<Schema>, Error>> + 'async_trait>>where 'life0: 'async_trait, CompositeStorage: 'async_trait,

source§

fn fetch_schema<'life0, 'life1, 'async_trait>( &'life0 self, table_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Option<Schema>, Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, CompositeStorage: 'async_trait,

source§

fn fetch_data<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, table_name: &'life1 str, key: &'life2 Key ) -> Pin<Box<dyn Future<Output = Result<Option<DataRow>, Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, CompositeStorage: 'async_trait,

source§

fn scan_data<'life0, 'life1, 'async_trait>( &'life0 self, table_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<(Key, DataRow), Error>>>>, Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, CompositeStorage: 'async_trait,

source§

impl StoreMut for CompositeStorage

source§

fn insert_schema<'life0, 'life1, 'async_trait>( &'life0 mut self, schema: &'life1 Schema ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, CompositeStorage: 'async_trait,

source§

fn delete_schema<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, CompositeStorage: 'async_trait,

source§

fn append_data<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str, rows: Vec<DataRow> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, CompositeStorage: 'async_trait,

source§

fn insert_data<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str, rows: Vec<(Key, DataRow)> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, CompositeStorage: 'async_trait,

source§

fn delete_data<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str, keys: Vec<Key> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, CompositeStorage: 'async_trait,

source§

impl Transaction for CompositeStorage

source§

fn begin<'life0, 'async_trait>( &'life0 mut self, autocommit: bool ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>where 'life0: 'async_trait, CompositeStorage: 'async_trait,

source§

fn rollback<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, CompositeStorage: 'async_trait,

source§

fn commit<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, CompositeStorage: 'async_trait,

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<S> GStore for Swhere S: Store + Index + Metadata + CustomFunction,

source§

impl<S> GStoreMut for Swhere S: StoreMut + IndexMut + AlterTable + Transaction + CustomFunction + CustomFunctionMut,

source§

impl<T> IStorage for Twhere T: GStore + GStoreMut,