Struct akd::storage::memory::AsyncInMemoryDbWithCache [−][src]
pub struct AsyncInMemoryDbWithCache { /* fields omitted */ }
Expand description
Represents an in-memory database with caching and metric calculation for benchmarking
Implementations
Flushes the cache and clearn any associated stats
Prints db states
Prints the distribution of the lengths of entries in a db
Trait Implementations
Log some information about the cache (hit rate, etc)
Start a transaction in the storage layer
fn commit_transaction<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn commit_transaction<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Commit a transaction in the storage layer
fn rollback_transaction<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn rollback_transaction<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Rollback a transaction
Retrieve a flag determining if there is a transaction active
Set a record in the data layer
Set multiple records in transactional operation
Retrieve a stored record from the data layer
Retrieve a batch of records by id
fn get_user_data<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 AkdKey
) -> 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 AkdKey
) -> 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
fn get_user_state<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 AkdKey,
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 AkdKey,
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
fn get_user_state_versions<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [AkdKey],
flag: ValueStateRetrievalFlag
) -> Pin<Box<dyn Future<Output = Result<HashMap<AkdKey, u64>, 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 [AkdKey],
flag: ValueStateRetrievalFlag
) -> Pin<Box<dyn Future<Output = Result<HashMap<AkdKey, u64>, 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
Retrieve the last epoch <= epoch_in_question
where the node with node_key
was edited Read more
Build an azks instance from the properties
fn build_history_tree_node(
label_val: u64,
label_len: u32,
birth_epoch: u64,
last_epoch: u64,
parent_label_val: u64,
parent_label_len: u32,
node_type: u8
) -> HistoryTreeNode
fn build_history_tree_node(
label_val: u64,
label_len: u32,
birth_epoch: u64,
last_epoch: u64,
parent_label_val: u64,
parent_label_len: u32,
node_type: u8
) -> HistoryTreeNode
Build a history tree node from the properties
fn build_history_node_state(
value: Vec<u8>,
child_states: [Option<HistoryChildState>; 2],
label_len: u32,
label_val: u64,
epoch: u64
) -> HistoryNodeState
fn build_history_node_state(
value: Vec<u8>,
child_states: [Option<HistoryChildState>; 2],
label_len: u32,
label_val: u64,
epoch: u64
) -> HistoryNodeState
Build a history node state from the properties
fn build_user_state(
username: String,
plaintext_val: String,
version: u64,
label_len: u32,
label_val: u64,
epoch: u64
) -> ValueState
fn build_user_state(
username: String,
plaintext_val: String,
version: u64,
label_len: u32,
label_val: u64,
epoch: u64
) -> ValueState
Build a user state from the properties
Auto Trait Implementations
impl !RefUnwindSafe for AsyncInMemoryDbWithCache
impl Unpin for AsyncInMemoryDbWithCache
impl !UnwindSafe for AsyncInMemoryDbWithCache
Blanket Implementations
Mutably borrows from an owned value. Read more