Expand description
Progress displays.
Port of rich/progress.py’s display and task model: a grid of tasks, one
row each, whose cells come from a list of ProgressColumns, laid out as
upstream’s make_tasks_table does: a Table::grid with padding=(0, 1),
each column’s table-column options, and expand.
Time is read from an injectable clock (Progress::clock, upstream’s
get_time), so elapsed time, speed, ETA and spinner frames are
deterministic under test. The default clock is monotonic.
Progress::start runs the display live on the Live
refresh thread (LiveProgress); LiveProgress::track and track
port track(). TextColumn format strings use pyformat.
transient and disable apply to the live display; LiveProgress::wrap_read
and LiveProgress::open port wrap_file and open.
Re-exports§
pub use crate::console::GetTime;
Structs§
- BarColumn
- A progress bar column’s width and styles. Port of
BarColumn’s arguments. - Live
Progress - A running
Progressdisplay. Task changes made through it are picked up by the next refresh, as with upstream’srefresh=Falseupdates. - Progress
- A progress display over one or more
Tasks. Mirrorsrich.progress.Progress. - Progress
Reader - A reader that advances a task by the bytes read through it. Returned by
LiveProgress::wrap_readandLiveProgress::open(upstream_Reader). - Spinner
Column - An animated spinner. Port of
SpinnerColumn: one spinner shared by every row, whose animation starts at its first render. - Task
- A single tracked task. Mirrors
rich.progress.Task; read-only outsideProgress. - TaskId
- Identifies a task within one
Progress. Upstream’sTaskID. - Task
Update - Changes for
Progress::update; unset fields are left alone. Upstream’s keyword arguments toProgress.update. - Text
Column - A text cell built from a format string. Port of
TextColumn: the format is expanded against the task astext_format.format(task=task), so it can use any task attribute ({task.completed},{task.percentage:>3.0f}) and per-task fields ({task.fields[name]}). - Time
Remaining Column - Estimated time remaining. Port of
TimeRemainingColumn, including its half-second render cache (max_refresh = 0.5). - Track
- The iterator
LiveProgress::trackreturns. - Track
Stdout - The iterator
trackreturns; it owns its live display.
Enums§
- Progress
Column - A column in a
Progressdisplay. Mirrors upstream’sProgressColumns.
Functions§
- track
- Track progress over
iterwith a live display on stdout. Port of the module-levelrich.progress.track: the description, bar, progress and time-remaining columns, refreshed ten times a second, stopped when the iterator is exhausted or dropped.