Expand description
§rusty-pv
A Rust port of Andrew Wood’s pv(1) pipe viewer — show progress, elapsed
time, ETA, rate, and bytes transferred while data flows through a pipe.
§Quick start
use rusty_pv::{PvBuilder};
use std::io::Cursor;
let pv = PvBuilder::new().total_bytes(1024).build();
let mut reader = Cursor::new(vec![0u8; 1024]);
let mut writer = Vec::new();
let n = pv.copy(&mut reader, &mut writer).unwrap();
assert_eq!(n, 1024);§Stability (lockstep SemVer)
Library and binary share a single crate version. The EMA smoothing
constant α = 0.3 is locked at v0.1.0 per ema::EMA_ALPHA — any
change is a MAJOR bump. The default display field order is
[<name>:] <p> <t> <e/I> <r> <b> <a> <n> regardless of CLI argv order.
Re-exports§
pub use error::PvError;pub use units::UnitSystem;
Modules§
- cursor
- Multi-instance cursor coordination via per-tty file lock (
-cmode). - ema
- Exponential moving average smoothing for displayed rate (FR-005, HINT-002).
- error
- Public error type for the rusty-pv library API (FR-047, FR-057).
- signals
- Unix signal handlers for SIGUSR1 + SIGWINCH (Unix-only, CLI-feature-gated).
- throttle
- Token-bucket throttle for
-L RATE(FR-022, AD-005, HINT-001). - units
- IEC binary + SI decimal unit-suffix math (FR-026/FR-027, AD-015).
Structs§
- Noop
Reporter - No-op reporter (default when no reporter is set on the builder).
- Progress
- Per-tick progress snapshot delivered to
Reporter::report(FR-045). - Pv
- Configured pipe-viewer runner. Construct via
PvBuilder. - PvBuilder
- Builder for
Pv(FR-043, FR-055). All methods are independent and order-agnostic; each setter is idempotent (last-write-wins).build()is INFALLIBLE.
Traits§
- Reporter
- Per-tick progress reporter (FR-044).