Skip to main content

LiveOutputObserver

Struct LiveOutputObserver 

Source
pub struct LiveOutputObserver<O, E>
where O: Write + Send, E: Write + Send,
{ /* private fields */ }
Expand description

Live-mode RunObserver per EXEC-016.

See the module-level docs for the presentation contract. Constructed with two sinks via Self::new; the inner sinks can be reclaimed with Self::into_inner after the run completes.

§Errors

Sink writes go through Write::write_all. The trait method signatures on RunObserver do NOT return errors; a write failure in the sink is therefore silently ignored at this layer. Production callers wire stdout and stderr to the parent process’s terminal streams, where write failure is a terminal-condition concern out of scope here. Tests use Vec<u8> sinks, which cannot fail.

Implementations§

Source§

impl<O, E> LiveOutputObserver<O, E>
where O: Write + Send, E: Write + Send,

Source

pub fn new(stdout: O, stderr: E) -> Self

Build an observer that writes complete lines to stdout and stderr with per-task tag prefixes from PlainPresenter (the historical [project:task] format, no per-task summary lines). Equivalent to Self::with_presenter called with Arc::new(PlainPresenter).

Source

pub fn with_presenter( stdout: O, stderr: E, presenter: Arc<dyn TaskPresenter>, ) -> Self

Build an observer that delegates prefix and summary-line rendering to presenter.

Callers that want color, glyph status markers, or per-task duration summaries inject a colour-aware presenter; library tests use the default PlainPresenter via Self::new.

Source

pub fn into_inner(self) -> (O, E)

Reclaim the two sinks after the run has finished and the observer is no longer borrowed by the scheduler. The returned tuple is (stdout, stderr).

Trait Implementations§

Source§

impl<O, E> RunObserver for LiveOutputObserver<O, E>
where O: Write + Send, E: Write + Send,

Source§

fn on_task_started(&self, task: &TaskId)

Called once at the start of the run, before any cache work.
Source§

fn on_stdout(&self, task: &TaskId, bytes: &[u8])

One chunk of captured stdout bytes. For a cache hit, called exactly once with the recorded stdout in full. For a fresh run, the call shape depends on the observer’s presentation strategy: a buffered observer typically receives a single call with the whole captured stdout; a live observer may receive many sub-line chunks as bytes flow from the pipe.
Source§

fn on_stderr(&self, task: &TaskId, bytes: &[u8])

One chunk of captured stderr bytes. Same call shape as Self::on_stdout.
Source§

fn on_task_finished(&self, task: &TaskId, record: &CompletedRecord)

Called once at the end of the run with the run-record classification. Fires only for tasks the scheduler admitted into the lookup-then-spawn pipeline; cascade- skipped tasks surface through Self::on_task_skipped instead.
Source§

fn on_task_skipped(&self, task: &TaskId, record: &SkipRecord)

Called once at the moment the scheduler marks task cascade-skipped per EXEC-010 / EXEC-011. Fires before the next admission round; NEVER paired with Self::on_task_started or Self::on_task_finished for the same task.
Source§

fn on_task_cancelled(&self, task: &TaskId, record: &CancelledRecord)

Called once at the moment the cancellation flow records a terminal state for task per EXEC-012..015. The CancelledRecord variant distinguishes the three shapes: an in-flight task that was signalled by the executor; a cascade descendant of a cancelled task; or a task drained from state.ready on cancel-fire. For an in-flight task, Self::on_task_started has already fired and Self::on_task_finished does NOT fire; for the other two shapes, no other lifecycle callback fires for the same task.

Auto Trait Implementations§

§

impl<O, E> !Freeze for LiveOutputObserver<O, E>

§

impl<O, E> !RefUnwindSafe for LiveOutputObserver<O, E>

§

impl<O, E> Send for LiveOutputObserver<O, E>

§

impl<O, E> Sync for LiveOutputObserver<O, E>

§

impl<O, E> Unpin for LiveOutputObserver<O, E>
where O: Unpin, E: Unpin,

§

impl<O, E> UnsafeUnpin for LiveOutputObserver<O, E>
where O: UnsafeUnpin, E: UnsafeUnpin,

§

impl<O, E> !UnwindSafe for LiveOutputObserver<O, E>

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V