pub trait StateStore: Send + Sync {
// Required methods
fn create_checkpoint(&self, checkpoint: Checkpoint) -> Result<bool>;
fn save_checkpoint(&self, checkpoint: Checkpoint) -> Result<()>;
fn load_checkpoint(&self, task_id: &str) -> Result<Option<Checkpoint>>;
fn claim_checkpoint(
&self,
task_id: &str,
cycle_index: u32,
claim_token: &str,
lease_expires_at_ms: u64,
now_ms: u64,
) -> Result<Option<Checkpoint>>;
fn commit_checkpoint(
&self,
checkpoint: Checkpoint,
claim_token: &str,
expected_revision: u64,
) -> Result<bool>;
fn renew_checkpoint_claim(
&self,
task_id: &str,
claim_token: &str,
expected_revision: u64,
lease_expires_at_ms: u64,
now_ms: u64,
) -> Result<bool>;
fn finalize_checkpoint(
&self,
checkpoint: Checkpoint,
expected_revision: u64,
) -> Result<bool>;
fn delete_checkpoint(&self, task_id: &str) -> Result<()>;
fn acknowledge_terminal(
&self,
task_id: &str,
expected_revision: u64,
) -> Result<bool>;
fn list_checkpoints(&self) -> Result<Vec<String>>;
fn state_store_spec(&self) -> Option<StateStoreSpec>;
}Required Methods§
fn create_checkpoint(&self, checkpoint: Checkpoint) -> Result<bool>
fn save_checkpoint(&self, checkpoint: Checkpoint) -> Result<()>
fn load_checkpoint(&self, task_id: &str) -> Result<Option<Checkpoint>>
fn claim_checkpoint( &self, task_id: &str, cycle_index: u32, claim_token: &str, lease_expires_at_ms: u64, now_ms: u64, ) -> Result<Option<Checkpoint>>
fn commit_checkpoint( &self, checkpoint: Checkpoint, claim_token: &str, expected_revision: u64, ) -> Result<bool>
fn renew_checkpoint_claim( &self, task_id: &str, claim_token: &str, expected_revision: u64, lease_expires_at_ms: u64, now_ms: u64, ) -> Result<bool>
fn finalize_checkpoint( &self, checkpoint: Checkpoint, expected_revision: u64, ) -> Result<bool>
fn delete_checkpoint(&self, task_id: &str) -> Result<()>
fn acknowledge_terminal( &self, task_id: &str, expected_revision: u64, ) -> Result<bool>
fn list_checkpoints(&self) -> Result<Vec<String>>
fn state_store_spec(&self) -> Option<StateStoreSpec>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".