pub struct LiveOutputObserver<O, E>{ /* 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>
impl<O, E> LiveOutputObserver<O, E>
Sourcepub fn new(stdout: O, stderr: E) -> Self
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).
Sourcepub fn with_presenter(
stdout: O,
stderr: E,
presenter: Arc<dyn TaskPresenter>,
) -> Self
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.
Sourcepub fn into_inner(self) -> (O, E)
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>
impl<O, E> RunObserver for LiveOutputObserver<O, E>
Source§fn on_task_started(&self, task: &TaskId)
fn on_task_started(&self, task: &TaskId)
Source§fn on_stdout(&self, task: &TaskId, bytes: &[u8])
fn on_stdout(&self, task: &TaskId, bytes: &[u8])
Source§fn on_stderr(&self, task: &TaskId, bytes: &[u8])
fn on_stderr(&self, task: &TaskId, bytes: &[u8])
Self::on_stdout.Source§fn on_task_finished(&self, task: &TaskId, record: &CompletedRecord)
fn on_task_finished(&self, task: &TaskId, record: &CompletedRecord)
Self::on_task_skipped instead.Source§fn on_task_skipped(&self, task: &TaskId, record: &SkipRecord)
fn on_task_skipped(&self, task: &TaskId, record: &SkipRecord)
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)
fn on_task_cancelled(&self, task: &TaskId, record: &CancelledRecord)
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.