Skip to main content

Restorable

Trait Restorable 

Source
pub trait Restorable: Send + Sync {
    // Required methods
    fn restore(&mut self, data: &[u8]) -> Result<(), RecoveryError>;
    fn apply_delta(&mut self, delta: &[u8]) -> Result<(), RecoveryError>;
    fn operator_id(&self) -> &str;
}
Expand description

Trait for operator state that can be restored from a checkpoint.

Required Methods§

Source

fn restore(&mut self, data: &[u8]) -> Result<(), RecoveryError>

Restore from a full snapshot blob.

§Errors

Returns RecoveryError::RestoreFailed if the data cannot be deserialized or applied.

Source

fn apply_delta(&mut self, delta: &[u8]) -> Result<(), RecoveryError>

Apply an incremental delta on top of the current state.

§Errors

Returns RecoveryError::RestoreFailed if the delta cannot be applied (e.g., base state missing).

Source

fn operator_id(&self) -> &str

Unique operator identifier (must match the key in the manifest).

Implementors§