| Crates.io | foothold |
| lib.rs | foothold |
| version | 0.1.0 |
| created_at | 2026-01-14 14:13:03.753295+00 |
| updated_at | 2026-01-14 14:13:03.753295+00 |
| description | Track, checkpoint, and resume long-running operations with detailed progress reporting |
| homepage | https://github.com/vauradkar/foothold |
| repository | https://github.com/vauradkar/foothold |
| max_upload_size | |
| id | 2042891 |
| size | 62,002 |
Foothold is a Rust crate for managing session state in batch processing tasks. It provides utilities for tracking completed, failed, and skipped tasks, persisting results, and computing statistics for current and previous sessions. The crate is designed to be thread-safe and efficient for large-scale operations.
Add foothold to your Cargo.toml:
[dependencies]
foothold = "0.1.0"
See crate documentation for a more examples.
use foothold::{Foothold, SyncConfig};
use std::path::Path;
// Define your task, success, and failure types
#[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
struct Task(String);
#[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
struct Success(String);
#[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
struct Failure(String);
fn main() -> Result<(), Box<dyn std::error::Error>> {
let completed_path = Path::new("completed.jsonl");
let failed_path = Path::new("failed.jsonl");
let sync_config = SyncConfig::create(Some(10), Some(100));
let mut foothold = Foothold::with_sync(completed_path, failed_path, 1000, sync_config)?;
// ... use foothold to mark tasks and get stats ...
Ok(())
}
Foothold<T, S, F>: Main struct for session managementSyncConfig: Configuration for disk sync operationsStats: Statistics for session progressRun tests with:
cargo test
Licensed under either of
at your option.