Struct MemoryStorage

Source
pub struct MemoryStorage {
    pub id_counter: i64,
    pub items: HashMap<String, Item>,
    pub metadata: HashMap<String, HashMap<String, Value>>,
    pub functions: HashMap<String, CustomFunction>,
}

Fields§

§id_counter: i64§items: HashMap<String, Item>§metadata: HashMap<String, HashMap<String, Value>>§functions: HashMap<String, CustomFunction>

Implementations§

Source§

impl MemoryStorage

Source

pub fn scan_data(&self, table_name: &str) -> Vec<(Key, DataRow)>

Trait Implementations§

Source§

impl AlterTable for MemoryStorage

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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: '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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: '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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: '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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

impl Clone for MemoryStorage

Source§

fn clone(&self) -> MemoryStorage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CustomFunction for MemoryStorage

Source§

fn fetch_function<'a, 'life0, 'async_trait>( &'a self, func_name: &'life0 str, ) -> Pin<Box<dyn Future<Output = Result<Option<&'a StructCustomFunction>>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source§

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

Source§

impl CustomFunctionMut for MemoryStorage

Source§

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

Source§

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

Source§

impl Debug for MemoryStorage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryStorage

Source§

fn default() -> MemoryStorage

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

impl<'de> Deserialize<'de> for MemoryStorage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Index for MemoryStorage

Source§

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

Source§

impl IndexMut for MemoryStorage

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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: '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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

impl Metadata for MemoryStorage

Source§

fn scan_table_meta<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<MetaIter>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl Serialize for MemoryStorage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Store for MemoryStorage

Source§

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

Source§

fn fetch_schema<'life0, 'life1, 'async_trait>( &'life0 self, table_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Schema>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn scan_data<'a, 'life0, 'async_trait>( &'a self, table_name: &'life0 str, ) -> Pin<Box<dyn Future<Output = Result<RowIter<'a>>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source§

fn fetch_referencings<'life0, 'life1, 'async_trait>( &'life0 self, table_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Referencing>, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source§

impl StoreMut for MemoryStorage

Source§

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

Source§

fn delete_schema<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Transaction for MemoryStorage

Source§

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

Source§

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

Source§

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<S> GStore for S

Source§

impl<S> GStoreMut for S