prodash/lib.rs
1#![deny(unsafe_code, missing_docs)]
2#![allow(clippy::empty_docs)]
3
4/*!
5Prodash is a dashboard for displaying the progress of concurrent application.
6
7It consists of two parts
8
9* a `Tree` to gather progress information and messages
10* a terminal user interface which displays this information, along with optional free-form information provided by the application itself
11
12Even though the `Tree` is not async, it's meant to be transparent and non-blocking performance wise, and benchmarks seem to indicate this
13is indeed the case.
14
15The **terminal user interface** seems to be the least transparent part, but can be configured to refresh less frequently.
16
17# Terminal User Interface
18
19By default, a TUI is provided to visualize all state. Have a look at [the example provided in the tui module](./tui/index.html).
20
21**Please note** that it is behind the `render-tui` feature toggle, which is enabled by default.
22
23# Logging
24
25If the feature `progress-tree-log` is enabled (default), most calls to `progress` will also be logged.
26That way, even without a terminal user interface, there will be progress messages.
27Please note that logging to stdout should not be performed with this feature enabled and a terminal user interface is shown, as this will
28seriously interfere with the TUI.
29
30# A demo application
31
32Please have a look at the [dashboard demo](https://github.com/Byron/crates-io-cli-rs/blob/master/prodash/examples/dashboard.rs).
33
34[](https://asciinema.org/a/301838)
35
36Run it with `cargo run --example dashboard` and see what else it can do by checking out `cargo run --example dashboard -- --help`.
37 */
38#[cfg(feature = "progress-tree")]
39///
40pub mod tree;
41
42///
43pub mod render;
44
45#[cfg(feature = "progress-tree-log")]
46pub use log::info;
47#[cfg(feature = "progress-tree-log")]
48pub use log::warn;
49
50#[cfg(any(feature = "jiff", feature = "local-time"))]
51///
52pub mod time;
53
54///
55pub mod unit;
56#[doc(inline)]
57pub use unit::Unit;
58
59///
60pub mod messages;
61///
62pub mod progress;
63
64mod traits;
65pub use traits::{
66 BoxedDynNestedProgress, BoxedProgress, Count, DynNestedProgress, DynNestedProgressToNestedProgress, NestedProgress,
67 Progress, Root, WeakRoot,
68};
69
70mod throughput;
71pub use crate::throughput::Throughput;
72
73#[cfg(not(feature = "progress-tree-log"))]
74mod log {
75 /// Stub
76 #[macro_export(local_inner_macros)]
77 macro_rules! warn {
78 (target: $target:expr, $($arg:tt)+) => {};
79 ($($arg:tt)+) => {};
80 }
81 /// Stub
82 #[macro_export(local_inner_macros)]
83 macro_rules! info {
84 (target: $target:expr, $($arg:tt)+) => {};
85 ($($arg:tt)+) => {};
86 }
87}