Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
strides
A command-line UI library to enhance async programs with progress bars and spinners.
The crate is built around two extension traits and two containers:
FutureExtadds.progress(theme)(sugar for.progressive().with_theme(theme)),.progressive()(unconfigured; inherits the parent Group's theme or renders withTheme::default()if awaited directly), and the.with_label(...)/.with_messages(...)/.with_progress(...)/.with_elapsed_time()setters that implicitly lift a bareFutureinto aProgressFuture.StreamExtadds.progress(theme, ...)/.progress_bytes(theme, ...)(sugar) and.progressive()/.progressive_bytes()(unconfigured) to anyStream.future::Groupruns manyFutures concurrently, rendering one line per task.stream::Groupruns manyStreams concurrently, rendering one line per stream.- For byte-counted file copies and downloads, convert an
AsyncReadto a byte stream (e.g. viatokio_util::io::ReaderStream) and use.progress_bytes(...).
Each .progress(...) call animates automatically and returns a builder for
further customization. A Theme bundles a Spinner, a Bar and a
Layout, and is accepted everywhere a theme is expected. A Layout is an
ordered list of Segments controlling the order, spacing and formatting of
each progress line. See spinner::styles and bar::styles for predefined
variants.
Pick a mode by how many tasks you have and how many terminal rows you want to spend on them:
| Tasks | Rows | Futures | Streams |
|---|---|---|---|
| 1 | 1 | fut.progress(theme).await |
s.progress(theme, ...) / s.progress_bytes(theme, ...) |
| N | N | Group::new(theme) + group.push(fut) per task |
stream::Group::new(theme) + group.push(s.progressive(...)) per stream |
| N | 1 | join(futs).with_theme(theme).await |
n/a |
| N | 1-of-many | group.push(join(futs).with_label(...)) |
n/a |
The last row uses future::join inside a future::Group: many futures
collapse into a single progress line that sits alongside other rows in the
Group. Streams do not have a join collapse, s— push each stream as its own
row.
Example
This example demonstrates how to animate single futures, a group of futures and
a stream. Run it with cargo run --example readme.
use Duration;
use Timer;
use StreamExt;
use ;
async
async
async
See the examples directory for more elaborate uses including downloads, dynamic messages, per-task progress bars, and custom layouts.
Minimum supported Rust version
strides requires Rust 1.85 or newer.