Skip to main content

Crate scanstate

Crate scanstate 

Source
Expand description

Generic checkpoint, journal, and progress primitives for scanners.

§Quick Start

use scanstate::ScanCheckpoint;

let mut checkpoint = ScanCheckpoint::new("my-scan-001");
checkpoint.mark_complete("https://target-1.com");
checkpoint.mark_complete("https://target-2.com");

assert!(checkpoint.is_complete("https://target-1.com"));
assert!(!checkpoint.is_complete("https://target-3.com"));
assert_eq!(checkpoint.completed_count(), 2);

Re-exports§

pub use checkpoint::CheckpointSettings;
pub use checkpoint::ScanCheckpoint;
pub use checkpoint::ScanStateError;
pub use journal::Entry;
pub use journal::WriteAheadJournal;
pub use progress::ScanProgress;

Modules§

checkpoint
Core checkpoint data structures for pausing and resuming workloads. Checkpoint persistence mechanism and JSON state definitions.
journal
Write-ahead transaction logging to prevent data loss on crashes. Write-ahead logging mechanism and structures.
progress
Runtime metric and ETA calculators tracking exact real-time execution speeds. Live progress indicators for tracking scan rates and ETAs.

Traits§

Checkpointable
Trait for any scan state that can be checkpointed.

Functions§

load_or_new
Load a checkpoint from file, or create a new empty one if the file doesn’t exist.