Skip to main content

RebuildReporter

Struct RebuildReporter 

Source
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

Source

pub fn new() -> Self

Create a fresh reporter. Detects whether stderr is a TTY once.

Source

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).

Source

pub fn error(&mut self, msg: &str)

Print a rebuild error, committing the previous rolling line first so it isn’t overwritten.

Source

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).

Trait Implementations§

Source§

impl Default for RebuildReporter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more