pub trait StateStore: Send + Sync {
// Required methods
fn get(
&self,
key: &str,
) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send;
fn set(
&self,
key: &str,
value: &[u8],
ttl_secs: Option<u64>,
) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send;
fn delete(&self, key: &str) -> impl Future<Output = Result<()>> + Send;
}Expand description
The StateStore trait defines the behavior storing and retrieving train state.
Required Methods§
Sourcefn get(&self, key: &str) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send
fn get(&self, key: &str) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send
Retrieve a previously stored value from the state store.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.