pub struct FileCheckpointStore { /* private fields */ }Expand description
Durable, file-system-backed checkpoint store.
Each checkpoint is written to root/{stream}/checkpoint-{sequence}.ckpt
using CheckpointState::serialize and an atomic temp-file + rename, so a
checkpoint that has been acknowledged is guaranteed to survive a process
crash or restart. Recovery scans the stream directory for the highest
sequence number. Pure Rust, no external services.
Implementations§
Trait Implementations§
Source§impl CheckpointStore for FileCheckpointStore
impl CheckpointStore for FileCheckpointStore
Source§fn 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.
Source§fn 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.Auto Trait Implementations§
impl Freeze for FileCheckpointStore
impl RefUnwindSafe for FileCheckpointStore
impl Send for FileCheckpointStore
impl Sync for FileCheckpointStore
impl Unpin for FileCheckpointStore
impl UnsafeUnpin for FileCheckpointStore
impl UnwindSafe for FileCheckpointStore
Blanket Implementations§
impl<T> Allocation for T
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