pub struct LocalDataStorage { /* private fields */ }Expand description
A local data storage implementation that stores data in memory.
This implementation uses local shared data storage for high-performance in-memory operations within a single node.
Trait Implementations§
Source§impl DataStorage for LocalDataStorage
impl DataStorage for LocalDataStorage
Source§async fn get_keys(&self) -> Result<Vec<String>, DataStorageError>
async fn get_keys(&self) -> Result<Vec<String>, DataStorageError>
Returns all keys currently stored in the store.
Source§async fn store<T: Serialize>(
&self,
key: &str,
mode: &StoreMode,
item: &T,
) -> Result<(), DataStorageError>
async fn store<T: Serialize>( &self, key: &str, mode: &StoreMode, item: &T, ) -> Result<(), DataStorageError>
Stores a serializable item for a given key using the provided
StoreMode.Source§async fn get<T: DeserializeOwned>(
&self,
key: &str,
) -> Result<Option<(T, String)>, DataStorageError>
async fn get<T: DeserializeOwned>( &self, key: &str, ) -> Result<Option<(T, String)>, DataStorageError>
Retrieves and deserializes the value for a given key, returning the value and its CAS
string if present. Returns
Ok(None) when the key does not exist.Source§async fn delete(&self, key: &str) -> Result<(), DataStorageError>
async fn delete(&self, key: &str) -> Result<(), DataStorageError>
Removes the item identified by the provided key from this storage instance.
Source§async fn delete_all(&self) -> Result<(), DataStorageError>
async fn delete_all(&self) -> Result<(), DataStorageError>
Removes all items from this storage instance.
Auto Trait Implementations§
impl Freeze for LocalDataStorage
impl !RefUnwindSafe for LocalDataStorage
impl !Send for LocalDataStorage
impl !Sync for LocalDataStorage
impl Unpin for LocalDataStorage
impl !UnwindSafe for LocalDataStorage
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