Skip to main content

BufferedOutputObserver

Struct BufferedOutputObserver 

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

Buffered-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

Same write-failure contract as LiveOutputObserver.

Implementations§

Source§

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

Source

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

Build an observer that accumulates per-task bytes and emits them as two contiguous blocks (stdout then stderr) on task completion, with prefix and summary-line rendering delegated to PlainPresenter. 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. Buffered mode ignores the prefix (captured bytes flush verbatim), but the presenter’s summary_* methods are still consulted on terminal callbacks; a None return suppresses the summary line.

Source

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

Reclaim the two sinks after the run has finished. Returns (stdout, stderr).

Trait Implementations§

Source§

impl<O, E> RunObserver for BufferedOutputObserver<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 BufferedOutputObserver<O, E>

§

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

§

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

§

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

§

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

§

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

§

impl<O, E> !UnwindSafe for BufferedOutputObserver<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