Struct typed_store::Store
source · [−]pub struct Store<K, V> { /* private fields */ }
Implementations
sourceimpl<Key, Value> Store<Key, Value> where
Key: Hash + Eq + Serialize + DeserializeOwned + Send + 'static,
Value: Serialize + DeserializeOwned + Send + Clone + 'static,
impl<Key, Value> Store<Key, Value> where
Key: Hash + Eq + Serialize + DeserializeOwned + Send + 'static,
Value: Serialize + DeserializeOwned + Send + Clone + 'static,
sourceimpl<Key, Value> Store<Key, Value> where
Key: Serialize + DeserializeOwned + Send,
Value: Serialize + DeserializeOwned + Send,
impl<Key, Value> Store<Key, Value> where
Key: Serialize + DeserializeOwned + Send,
Value: Serialize + DeserializeOwned + Send,
pub async fn write(&self, key: Key, value: Value)
sourcepub async fn write_all(
&self,
key_value_pairs: impl IntoIterator<Item = (Key, Value)>
) -> Result<(), StoreError>
pub async fn write_all(
&self,
key_value_pairs: impl IntoIterator<Item = (Key, Value)>
) -> Result<(), StoreError>
Atomically writes all the key-value pairs in storage. If the operation is successful, then the result will be a non error empty result. Otherwise the error is returned.
pub async fn remove(&self, key: Key)
sourcepub async fn remove_all(
&self,
keys: impl IntoIterator<Item = Key>
) -> Result<(), StoreError>
pub async fn remove_all(
&self,
keys: impl IntoIterator<Item = Key>
) -> Result<(), StoreError>
Atomically removes all the data referenced by the provided keys. If the operation is successful, then the result will be a non error empty result. Otherwise the error is returned.
pub async fn read(&self, key: Key) -> Result<Option<Value>, StoreError>
sourcepub async fn read_all(
&self,
keys: impl IntoIterator<Item = Key>
) -> Result<Vec<Option<Value>>, StoreError>
pub async fn read_all(
&self,
keys: impl IntoIterator<Item = Key>
) -> Result<Vec<Option<Value>>, StoreError>
Fetches all the values for the provided keys.
pub async fn notify_read(&self, key: Key) -> Result<Option<Value>, StoreError>
Trait Implementations
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for Store<K, V>
impl<K, V> Send for Store<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for Store<K, V> where
K: Send,
V: Send,
impl<K, V> Unpin for Store<K, V>
impl<K, V> !UnwindSafe for Store<K, V>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more