atomic_progress/lib.rs
1//! # `atomic_progress`
2//!
3//! A high-performance, thread-safe, and cloneable progress tracking library.
4//!
5//! `atomic_progress` provides primitives for tracking the state of long-running operations.
6//! It is designed to be:
7//!
8//! * **Headless**: It stores state (position, total, time) but does not enforce a specific rendering implementation.
9//! * **Concurrent**: Progress handles are cheap to clone ([`Arc`]-based) and safe to share across threads.
10//! * **Low Overhead**: Uses atomic primitives for hot-path updates (incrementing position) and coarse-grained locking ([`RwLock`]) for cold paths (metadata, snapshots).
11//!
12//! ## Modules
13//!
14//! * [`builder`]: Fluent interface for constructing complex [`Progress`] instances.
15//! * [`io`]: Wrappers for [`std::io::Read`] and [`std::io::Write`] that track progress automatically.
16//! * [`iter`]: Extension traits for tracking progress on Iterators.
17//! * [`progress`]: The core [`Progress`] state machine and snapshot logic.
18//! * [`stack`]: A collection for managing multiple progress indicators simultaneously.
19
20#![forbid(unsafe_code)]
21#![deny(missing_docs)]
22
23pub mod builder;
24pub mod frontends;
25pub mod io;
26pub mod iter;
27pub mod progress;
28pub mod stack;
29
30pub use builder::ProgressBuilder;
31pub use iter::{ProgressIter, ProgressIteratorExt};
32pub use progress::{Progress, ProgressSnapshot, ProgressType};
33pub use stack::{ProgressStack, ProgressStackSnapshot};
34
35#[cfg(feature = "terminal")]
36pub use frontends::terminal::TerminalFrontend;
37
38// Re-export byte formatting primitives so consumers do not need to depend on
39// `prettier-bytes` directly just to configure the terminal output.
40#[cfg(feature = "terminal")]
41pub use prettier_bytes::{ByteFormatter, Standard, Unit};