Expand description
Presenter port for crate::output observers.
The execution engine (haz-exec) emits a stream of lifecycle
events through crate::run_task::RunObserver. The bytes that
reach the user’s terminal are produced by an observer
implementation in crate::output. Two of those bytes are
presentation-policy choices the engine has no opinion on:
- the per-task line prefix that tags each captured line with
the bearing task identity in
livemode; - the optional per-task summary line emitted on a task’s terminal callback (“done”, “cached”, “failed”, “skipped”, “cancelled”).
The TaskPresenter trait is the seam: an observer holds an
Arc<dyn TaskPresenter> and asks it for prefix bytes and
summary-line bytes at the right moments in the lifecycle. The
presenter sees only TaskIds and the run records the
observer already has in hand; it has no view of the underlying
sink, the cancellation token, or the cache.
The library ships PlainPresenter as the default: it emits
the historical [project:task] prefix and returns None
for every summary method, so a cargo test --all-features run
sees identical bytes to the pre-trait behaviour. A
terminal-aware presenter (color, glyphs, durations) lives in
the consuming binary (haz-cli’s output module) and never
pulls a colour crate into haz-exec.
Structs§
- Plain
Presenter - Default
TaskPresenterused by the barecrate::output::LiveOutputObserver::newandcrate::output::BufferedOutputObserver::newconstructors.
Traits§
- Task
Presenter - Strategy object the
crate::outputobservers consult for presentation-policy bytes.