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§
- Never
Cancel - A
Cancelthat never signals cancellation. The default for call sites that do not support interruption. - Null
Progress - A
ProgressSinkthat 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.
- Progress
Sink - A sink for progress updates emitted by a library operation.