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§
Sourcefn restore(&mut self, data: &[u8]) -> Result<(), RecoveryError>
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.
Sourcefn apply_delta(&mut self, delta: &[u8]) -> Result<(), RecoveryError>
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).
Sourcefn operator_id(&self) -> &str
fn operator_id(&self) -> &str
Unique operator identifier (must match the key in the manifest).