pub struct MockStore { /* private fields */ }Expand description
A HashMap-backed EncryptedStore for unit tests and local development.
NOT suitable for production — no persistence, no concurrency safety.
Implementations§
Trait Implementations§
Source§impl EncryptedStore for MockStore
impl EncryptedStore for MockStore
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 Tag,
) -> Pin<Box<dyn Future<Output = Result<Option<EncValue>, VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 Tag,
) -> Pin<Box<dyn Future<Output = Result<Option<EncValue>, VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the encrypted value stored at
tag, if any.Source§fn put<'life0, 'async_trait>(
&'life0 self,
tag: Tag,
value: EncValue,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
tag: Tag,
value: EncValue,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a single (tag, value) pair. Overwrites any existing entry.
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 Tag,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 Tag,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove the entry at
tag. No-op if tag does not exist.Source§fn get_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
tags: &'life1 [Tag],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<EncValue>>, VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
tags: &'life1 [Tag],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<EncValue>>, VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch multiple tags in a single round-trip. Read more
Source§fn atomic_update<'life0, 'async_trait>(
&'life0 self,
puts: Vec<RawEdbEntry>,
removes: Vec<Tag>,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn atomic_update<'life0, 'async_trait>(
&'life0 self,
puts: Vec<RawEdbEntry>,
removes: Vec<Tag>,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write multiple entries and delete a set of old tags atomically. Read more
Source§fn padded_put_batch<'life0, 'async_trait>(
&'life0 self,
real_entries: Vec<RawEdbEntry>,
target_count: usize,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn padded_put_batch<'life0, 'async_trait>(
&'life0 self,
real_entries: Vec<RawEdbEntry>,
target_count: usize,
) -> Pin<Box<dyn Future<Output = Result<(), VaultError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write exactly
target_count entries, padding with dummy entries if needed. Read moreAuto Trait Implementations§
impl !Freeze for MockStore
impl RefUnwindSafe for MockStore
impl Send for MockStore
impl Sync for MockStore
impl Unpin for MockStore
impl UnsafeUnpin for MockStore
impl UnwindSafe for MockStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more