pub struct RebuildReporter { /* private fields */ }Expand description
Stateful terminal reporter for rebuild loops.
Tracks whether the previous output was a rolling rebuild line so the
next line can either repaint it (consecutive success) or commit it
with a newline (error, banner). Cheap to construct; not Clone —
instances are typically owned by a single rebuild worker.
When stderr is not a TTY (piped to a logger, captured by tools like
concurrently, or running in CI), the rolling line is replaced with
plain newline-terminated lines so wrappers can flush each rebuild
promptly.
Implementations§
Source§impl RebuildReporter
impl RebuildReporter
Sourcepub fn success(&mut self, elapsed: Duration)
pub fn success(&mut self, elapsed: Duration)
Print a successful rebuild line. In an interactive terminal,
consecutive successes repaint a single line in place; otherwise
each rebuild prints its own newline-terminated line so log
wrappers (concurrently, CI capture, file redirects) flush it.
Always writes to stderr so it lands on the same stream as the rest of the dev server’s diagnostic output (banners, field tables, errors).
Sourcepub fn error(&mut self, msg: &str)
pub fn error(&mut self, msg: &str)
Print a rebuild error, committing the previous rolling line first so it isn’t overwritten.
Sourcepub fn commit_pending(&mut self)
pub fn commit_pending(&mut self)
Commit any pending rolling rebuild line with a trailing newline, so subsequent unrelated output (banner, info message) doesn’t land on the same line. No-op when not in interactive mode (those lines are already newline-terminated).