Skip to main content

Crate hm_render

Crate hm_render 

Source
Expand description

Build-event renderers shared by the hm CLI and the cloud plugin.

This crate owns the output layer: the OutputRenderer trait, the OutputMode selection enum, and the concrete renderers (HumanRenderer, ProgressRenderer, JsonRenderer). All of them consume hm_plugin_protocol::BuildEvents; nothing here depends on hm internals (no RunContext, no Docker types).

Re-exports§

pub use human::HumanRenderer;
pub use json::JsonRenderer;
pub use progress::ProgressRenderer;

Modules§

human
Human-readable OutputRenderer — replaces the former hm-plugin-output-human WASM plugin with a plain struct that writes formatted lines to any std::io::Write target.
json
JSON-lines OutputRenderer — replaces the former hm-plugin-output-json WASM plugin. Serialises each BuildEvent as a single JSON line.
progress
Progress-bar OutputRenderer — bridges BuildEvents into tracing spans that tracing-indicatif renders as live progress bars.
spinner

Enums§

OutputMode
How to render output. Determined at startup from CLI flags and TTY detection.

Traits§

OutputRenderer
Synchronous observer of BuildEvents.

Functions§

color_enabled
Whether ANSI color should be used: honors an explicit no-color flag, the NO_COLOR env convention, and whether stderr is a TTY.
drive
Drive a renderer from an mpsc stream of events.
drive_stream
Drive a renderer from a Stream of events until it ends or a BuildEnd is seen.
renderer_for
Build the renderer for a run.
stderr_interactive
Whether stderr is an interactive terminal (drives the progress view).
stdout_piped
Whether stdout is NOT a TTY (i.e. piped) — used to force the streaming log view.