pub trait StateStore {
type Error: Error + Send + Sync + 'static;
// Required methods
fn load(
&self,
job_id: &str,
) -> impl Future<Output = Result<Option<JobState>, Self::Error>> + Send;
fn save(
&self,
state: &JobState,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
// Provided methods
fn delete(
&self,
_job_id: &str,
) -> impl Future<Output = Result<(), Self::Error>> + Send { ... }
fn drain_events(
&self,
) -> impl Future<Output = Result<Vec<StoreEvent>, Self::Error>> + Send { ... }
fn classify_error(_error: &Self::Error) -> StoreErrorKind
where Self: Sized { ... }
}Required Associated Types§
Required Methods§
fn load( &self, job_id: &str, ) -> impl Future<Output = Result<Option<JobState>, Self::Error>> + Send
fn save( &self, state: &JobState, ) -> impl Future<Output = Result<(), Self::Error>> + Send
Provided Methods§
fn delete( &self, _job_id: &str, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn drain_events( &self, ) -> impl Future<Output = Result<Vec<StoreEvent>, Self::Error>> + Send
fn classify_error(_error: &Self::Error) -> StoreErrorKindwhere
Self: Sized,
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.