pub trait CheckpointStore {
// Required methods
fn save(&mut self, state: CheckpointState) -> Result<(), StreamingError>;
fn latest(
&self,
stream_id: &str,
) -> Result<Option<CheckpointState>, StreamingError>;
}Expand description
Storage backend for stream checkpoints.
Implementations decide where checkpoint state lives. CheckpointManager
is generic over this trait so the same driver can target an in-memory store
(InMemoryCheckpointStore) for tests/single-process use or a durable
backend (FileCheckpointStore) that survives a crash/restart.
Required Methods§
Sourcefn save(&mut self, state: CheckpointState) -> Result<(), StreamingError>
fn save(&mut self, state: CheckpointState) -> Result<(), StreamingError>
Persist a checkpoint. Later checkpoints for the same stream supersede earlier ones.
Sourcefn latest(
&self,
stream_id: &str,
) -> Result<Option<CheckpointState>, StreamingError>
fn latest( &self, stream_id: &str, ) -> Result<Option<CheckpointState>, StreamingError>
Return the most recent checkpoint for stream_id, or None if the
stream has no checkpoints.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".