Trait omaha_client::storage::StorageExt
source · pub trait StorageExt: Storage {
// Provided methods
fn set_option_int<'a>(
&'a mut self,
key: &'a str,
value: Option<i64>
) -> BoxFuture<'_, Result<(), Self::Error>> { ... }
fn get_time<'a>(&'a self, key: &'a str) -> BoxFuture<'_, Option<SystemTime>> { ... }
fn set_time<'a>(
&'a mut self,
key: &'a str,
value: impl Into<SystemTime>
) -> BoxFuture<'_, Result<(), Self::Error>> { ... }
fn remove_or_log<'a>(&'a mut self, key: &'a str) -> BoxFuture<'_, ()> { ... }
fn commit_or_log(&mut self) -> BoxFuture<'_, ()> { ... }
}
Expand description
Extension trait that adds some features to Storage that can be implemented using the base
Storage
implementation.
Provided Methods§
sourcefn set_option_int<'a>(
&'a mut self,
key: &'a str,
value: Option<i64>
) -> BoxFuture<'_, Result<(), Self::Error>>
fn set_option_int<'a>( &'a mut self, key: &'a str, value: Option<i64> ) -> BoxFuture<'_, Result<(), Self::Error>>
Set an Option
sourcefn get_time<'a>(&'a self, key: &'a str) -> BoxFuture<'_, Option<SystemTime>>
fn get_time<'a>(&'a self, key: &'a str) -> BoxFuture<'_, Option<SystemTime>>
Get a SystemTime from the backing store. Returns None if there is no value for the given key, or if the value for the key has a different type.
sourcefn set_time<'a>(
&'a mut self,
key: &'a str,
value: impl Into<SystemTime>
) -> BoxFuture<'_, Result<(), Self::Error>>
fn set_time<'a>( &'a mut self, key: &'a str, value: impl Into<SystemTime> ) -> BoxFuture<'_, Result<(), Self::Error>>
Set a SystemTime to be stored in the backing store. The implementation should cache the value until the |commit()| fn is called, and then persist all cached values at that time. Note that submicrosecond will be dropped.
sourcefn remove_or_log<'a>(&'a mut self, key: &'a str) -> BoxFuture<'_, ()>
fn remove_or_log<'a>(&'a mut self, key: &'a str) -> BoxFuture<'_, ()>
Remove the value for |key| from the backing store, log an error message on error.
sourcefn commit_or_log(&mut self) -> BoxFuture<'_, ()>
fn commit_or_log(&mut self) -> BoxFuture<'_, ()>
Persist all cached values to storage, log an error message on error.