pub struct LocalDataStorage<F: Format = Fixint> { /* 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<F: Format> DataStorage for LocalDataStorage<F>
impl<F: Format> DataStorage for LocalDataStorage<F>
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<F = Fixint> !RefUnwindSafe for LocalDataStorage<F>
impl<F = Fixint> !Send for LocalDataStorage<F>
impl<F = Fixint> !Sync for LocalDataStorage<F>
impl<F = Fixint> !UnwindSafe for LocalDataStorage<F>
impl<F> Freeze for LocalDataStorage<F>
impl<F> Unpin for LocalDataStorage<F>where
F: Unpin,
impl<F> UnsafeUnpin for LocalDataStorage<F>
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