Struct akd::storage::memory::AsyncInMemoryDatabase
source · pub struct AsyncInMemoryDatabase { /* private fields */ }
Expand description
This struct represents a basic in-memory database.
Implementations
Trait Implementations
sourceimpl Clone for AsyncInMemoryDatabase
impl Clone for AsyncInMemoryDatabase
sourceimpl Database for AsyncInMemoryDatabase
impl Database for AsyncInMemoryDatabase
sourcefn get<'life0, 'life1, 'async_trait, St>(
&'life0 self,
id: &'life1 St::StorageKey
) -> Pin<Box<dyn Future<Output = Result<DbRecord, StorageError>> + Send + 'async_trait>>where
St: 'async_trait + Storable,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get<'life0, 'life1, 'async_trait, St>(
&'life0 self,
id: &'life1 St::StorageKey
) -> Pin<Box<dyn Future<Output = Result<DbRecord, StorageError>> + Send + 'async_trait>>where
St: 'async_trait + Storable,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieve a stored record from the data layer
sourcefn batch_get<'life0, 'life1, 'async_trait, St>(
&'life0 self,
ids: &'life1 [St::StorageKey]
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRecord>, StorageError>> + Send + 'async_trait>>where
St: 'async_trait + Storable,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn batch_get<'life0, 'life1, 'async_trait, St>(
&'life0 self,
ids: &'life1 [St::StorageKey]
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRecord>, StorageError>> + Send + 'async_trait>>where
St: 'async_trait + Storable,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieve a batch of records by id
sourcefn get_user_data<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 AkdLabel
) -> Pin<Box<dyn Future<Output = Result<KeyData, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_user_data<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 AkdLabel
) -> Pin<Box<dyn Future<Output = Result<KeyData, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieve the user data for a given user
sourcefn get_user_state<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 AkdLabel,
flag: ValueStateRetrievalFlag
) -> Pin<Box<dyn Future<Output = Result<ValueState, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_user_state<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 AkdLabel,
flag: ValueStateRetrievalFlag
) -> Pin<Box<dyn Future<Output = Result<ValueState, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieve a specific state for a given user
sourcefn set<'life0, 'async_trait>(
&'life0 self,
record: DbRecord
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
record: DbRecord
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Set a record in the database
sourcefn batch_set<'life0, 'async_trait>(
&'life0 self,
records: Vec<DbRecord>,
_state: DbSetState
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn batch_set<'life0, 'async_trait>(
&'life0 self,
records: Vec<DbRecord>,
_state: DbSetState
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Set multiple records in the database with a minimal set of operations
sourcefn get_user_state_versions<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [AkdLabel],
flag: ValueStateRetrievalFlag
) -> Pin<Box<dyn Future<Output = Result<HashMap<AkdLabel, (u64, AkdValue)>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_user_state_versions<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [AkdLabel],
flag: ValueStateRetrievalFlag
) -> Pin<Box<dyn Future<Output = Result<HashMap<AkdLabel, (u64, AkdValue)>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieve the user -> state version mapping in bulk. This is the same as get_user_states but with less data retrieved from the storage layer
sourceimpl Debug for AsyncInMemoryDatabase
impl Debug for AsyncInMemoryDatabase
sourceimpl Default for AsyncInMemoryDatabase
impl Default for AsyncInMemoryDatabase
sourceimpl StorageUtil for AsyncInMemoryDatabase
impl StorageUtil for AsyncInMemoryDatabase
sourcefn batch_get_type_direct<'life0, 'async_trait, St>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRecord>, StorageError>> + Send + 'async_trait>>where
St: 'async_trait + Storable,
'life0: 'async_trait,
Self: 'async_trait,
fn batch_get_type_direct<'life0, 'async_trait, St>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRecord>, StorageError>> + Send + 'async_trait>>where
St: 'async_trait + Storable,
'life0: 'async_trait,
Self: 'async_trait,
Retrieves all stored records of a given type from the data layer, ignoring any caching or transaction pending
sourcefn batch_get_all_direct<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn batch_get_all_direct<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Retrieves all stored records from the data layer, ignoring any caching or transaction pending
impl Send for AsyncInMemoryDatabase
impl Sync for AsyncInMemoryDatabase
Auto Trait Implementations
impl !RefUnwindSafe for AsyncInMemoryDatabase
impl Unpin for AsyncInMemoryDatabase
impl !UnwindSafe for AsyncInMemoryDatabase
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more