Features
- Async-first: Built around Rust's async/await and Stream APIs
- Zero-allocation progress updates: Efficient progress reporting
- Flexible progress tracking: Support for current/total, messages, and cancellation
- Type-safe: Full Rust type safety with meaningful error messages
- Lightweight: Minimal dependencies and fast compilation
Usage
Add this to your Cargo.toml:
[]
= "0.0.1"
Simple Progress Monitoring (Recommended)
Using the observe extension method for easy progress monitoring:
use ;
async
Advanced Manual Control
For more control over progress monitoring using streams:
use ;
use StreamExt;
async
API Reference
ProgressUpdate
Represents a single progress update with:
current(): Current progress valuetotal(): Total progress valuestate(): Current state (Working, Paused, Completed, Cancelled)message(): Optional progress messagecompleted_fraction(): Progress as a fraction (0.0 to 1.0)remaining(): Remaining work (total - current)
Progress Trait
Trait for types that can report progress via a Stream of ProgressUpdates.
ProgressExt Trait
Extension trait providing convenient methods:
observe(receiver): Monitor progress with a callback functionobserve_local(receiver): Local version that doesn't requireSendbounds
progress() Function
Creates a progress-tracked future from a closure that receives a ProgressUpdater.
ProgressUpdater
Handle for updating progress during execution:
update(current): Update progress valueupdate_with_message(current, message): Update with messagepause(): Pause the operationcancel(): Cancel the operation
License
Licensed under the MIT License. See LICENSE for details.