rusty-pv 0.1.0

Pipe viewer — a Rust port of Andrew Wood's `pv(1)` with progress bar, ETA, rate display, token-bucket rate limiting, IEC/SI unit math, SIGWINCH-aware terminal redraw, SIGUSR1 size refresh, multi-instance cursor coordination, and a typed library API.
Documentation
//! Public error type for the rusty-pv library API (FR-047, FR-057).

/// Error type returned by [`Pv`](crate::Pv) operations.
///
/// `#[non_exhaustive]` allows additive variants in SemVer-minor releases per
/// FR-057. Downstream code MUST use a wildcard `_` arm when matching.
#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum PvError {
    /// I/O failure during a read or write operation.
    #[error("rusty-pv: I/O error: {source}")]
    Io {
        /// Underlying `std::io::Error`.
        #[source]
        source: std::io::Error,
    },

    /// Rate-limit value was invalid (could not be parsed or is non-positive).
    #[error("rusty-pv: invalid rate limit value: '{value}'")]
    RateLimitInvalid {
        /// The offending input value.
        value: String,
    },

    /// Size hint value was invalid (could not be parsed or is non-positive).
    #[error("rusty-pv: invalid size value: '{value}'")]
    SizeInvalid {
        /// The offending input value.
        value: String,
    },
}

impl From<std::io::Error> for PvError {
    fn from(source: std::io::Error) -> Self {
        PvError::Io { source }
    }
}