pub struct StateRecovery { /* private fields */ }Expand description
Manages checkpoint persistence and recovery.
Implementations§
Source§impl StateRecovery
impl StateRecovery
Sourcepub async fn persist_checkpoint(
&self,
checkpoint: &StateCheckpoint,
) -> RecoveryResult<()>
pub async fn persist_checkpoint( &self, checkpoint: &StateCheckpoint, ) -> RecoveryResult<()>
Sourcepub async fn recover_checkpoint(&self) -> RecoveryResult<StateCheckpoint>
pub async fn recover_checkpoint(&self) -> RecoveryResult<StateCheckpoint>
Recovers the most recent checkpoint from the journal.
§Errors
Returns RecoveryError::NoCheckpoint if no checkpoint exists.
Returns RecoveryError::CorruptedCheckpoint if checkpoint data is invalid.
Sourcepub fn create_checkpoint(
agent_id: AgentId,
agent_state: AgentState,
app_state: Value,
in_flight_tasks: u32,
) -> StateCheckpoint
pub fn create_checkpoint( agent_id: AgentId, agent_state: AgentState, app_state: Value, in_flight_tasks: u32, ) -> StateCheckpoint
Creates a checkpoint from current agent state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StateRecovery
impl !RefUnwindSafe for StateRecovery
impl Send for StateRecovery
impl Sync for StateRecovery
impl Unpin for StateRecovery
impl !UnwindSafe for StateRecovery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more