pub struct PipelineReporter { /* private fields */ }Expand description
Emits structured pipeline events to a callback.
This is the pipeline-level equivalent of ProgressReporter.
The callback receives a PipelineEvent which can be serialized
to JSON and sent to the UI (via Web Worker postMessage, CLI stdout,
or any other transport).
Implementations§
Source§impl PipelineReporter
impl PipelineReporter
Sourcepub fn new(callback: impl Fn(PipelineEvent) + 'static) -> Self
pub fn new(callback: impl Fn(PipelineEvent) + 'static) -> Self
Create a new reporter with a callback that receives pipeline events.
USAGE:
use bnto_core::PipelineReporter;
let reporter = PipelineReporter::new(|event| {
println!("Pipeline event: {:?}", event);
});Sourcepub fn new_noop() -> Self
pub fn new_noop() -> Self
Create a no-op reporter that discards all events. Used in tests where we don’t need event tracking.
Sourcepub fn emit(&self, event: PipelineEvent)
pub fn emit(&self, event: PipelineEvent)
Emit a pipeline event. If no callback is set (no-op mode), the event is silently discarded.
Auto Trait Implementations§
impl Freeze for PipelineReporter
impl !RefUnwindSafe for PipelineReporter
impl !Send for PipelineReporter
impl !Sync for PipelineReporter
impl Unpin for PipelineReporter
impl UnsafeUnpin for PipelineReporter
impl !UnwindSafe for PipelineReporter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more