cargo-aprz-lib 0.14.0

Internal library for cargo-aprz
Documentation
/// A trait for reporting progress of long-running operations.
pub trait Progress: Send + Sync {
    /// Set the phase label for the current operation (e.g., "Preparing", "Collecting").
    fn set_phase(&self, phase: &str);

    /// Configure determinate progress reporting.
    ///
    /// The callback should return (total, current, message) to show progress
    /// as a percentage or fraction.
    fn set_determinate(&self, callback: Box<dyn Fn() -> (u64, u64, String) + Send + Sync + 'static>);

    /// Configure indeterminate progress reporting.
    ///
    /// The callback should return a message string. Use this for operations
    /// where the total amount of work is unknown.
    fn set_indeterminate(&self, callback: Box<dyn Fn() -> String + Send + Sync + 'static>);

    /// Print a message line without disrupting the progress indicator.
    fn println(&self, msg: &str);

    /// Finish and clear the progress indicator.
    fn done(&self);

    /// Whether color output is enabled for the progress display.
    fn use_colors(&self) -> bool {
        false
    }
}