pub struct JsonProgress { /* private fields */ }Expand description
JSON progress reporter — one compact JSON object per event to stderr.
Each event is serialised with serde_json and written as a single
newline-terminated line:
{"event":"triggered","id":"abc123"}
{"event":"polling","elapsed_s":12,"status":"in_progress"}
{"event":"downloading"}
{"event":"done","bytes":12345}The Done event is emitted (unlike HumanProgress) so JSON consumers
can parse a complete event stream without relying solely on the final
stdout object from the renderer.
Implementations§
Source§impl JsonProgress
impl JsonProgress
Sourcepub fn with_writer(w: impl Write + 'static) -> Self
pub fn with_writer(w: impl Write + 'static) -> Self
Creates a reporter writing to an arbitrary Write sink (used in tests).
Trait Implementations§
Source§impl Default for JsonProgress
impl Default for JsonProgress
Source§impl ProgressReporter for JsonProgress
impl ProgressReporter for JsonProgress
Auto Trait Implementations§
impl !RefUnwindSafe for JsonProgress
impl !Send for JsonProgress
impl !Sync for JsonProgress
impl !UnwindSafe for JsonProgress
impl Freeze for JsonProgress
impl Unpin for JsonProgress
impl UnsafeUnpin for JsonProgress
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