Skip to main content

Module progress

Module progress 

Source
Expand description

Progress reporting and cancellation across the library/CLI boundary.

Library operations never touch the terminal. Long-running work reports progress through a ProgressSink supplied by the caller and checks a Cancel signal at loop boundaries. The CLI provides a concrete sink that draws to stderr (gated on isatty) and decides colour, redraw rate, and whether a pager is attached; the library makes none of those decisions.

Tests, grit-simple, and any call site that does not want output use the no-op NullProgress / NeverCancel.

Structs§

NeverCancel
A Cancel that never signals cancellation. The default for call sites that do not support interruption.
NullProgress
A ProgressSink that discards every update. The default for tests, grit-simple, and any call site that does not want progress output.

Traits§

Cancel
A cancellation signal checked by long-running library operations at loop boundaries. Implementations must be cheap to query.
ProgressSink
A sink for progress updates emitted by a library operation.