pub struct CheckpointWriter { /* private fields */ }Expand description
Buffered checkpoint writer for resume logging.
Entries are buffered in memory and flushed to disk when either:
- The buffer reaches
flush_thresholdentries, or flush_intervalhas elapsed since the last flush.
Implementations§
Source§impl CheckpointWriter
impl CheckpointWriter
Sourcepub fn new(
log_file: impl AsRef<Path>,
flush_threshold: usize,
flush_interval: Duration,
) -> Self
pub fn new( log_file: impl AsRef<Path>, flush_threshold: usize, flush_interval: Duration, ) -> Self
Create a new checkpoint writer.
log_file: Path to the checkpoint log file (appended to).flush_threshold: Maximum entries before auto-flush (default: 128).flush_interval: Maximum time between flushes (default: 250ms).
Sourcepub fn with_defaults(log_file: impl AsRef<Path>) -> Self
pub fn with_defaults(log_file: impl AsRef<Path>) -> Self
Create with default settings (threshold=128, interval=250ms).
Auto Trait Implementations§
impl !Freeze for CheckpointWriter
impl RefUnwindSafe for CheckpointWriter
impl Send for CheckpointWriter
impl Sync for CheckpointWriter
impl Unpin for CheckpointWriter
impl UnsafeUnpin for CheckpointWriter
impl UnwindSafe for CheckpointWriter
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