pub struct ReportState { /* private fields */ }Expand description
The cached, merged printer state.
Seed it with the pushall snapshot and feed every subsequent report message
through ReportState::apply; both go through the same merge so a snapshot
is just a delta that happens to contain everything.
Implementations§
Source§impl ReportState
impl ReportState
Sourcepub fn apply(&mut self, message: Value)
pub fn apply(&mut self, message: Value)
Merge one report message (snapshot or delta) into the cached state.
A new print inherits the just-finished job’s mc_percent/layer_num:
the printer reports the new task_id well before the first fresh percent,
so a job in preheat/calibration would read 100% / the old layer count.
When the merge reveals a new (different, non-empty) print identity, zero
those carried-over fields — but only the ones this very message didn’t set,
so a report that brings its own fresh progress is trusted.
Trait Implementations§
Source§impl Clone for ReportState
impl Clone for ReportState
Source§fn clone(&self) -> ReportState
fn clone(&self) -> ReportState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReportState
impl Debug for ReportState
Auto Trait Implementations§
impl Freeze for ReportState
impl RefUnwindSafe for ReportState
impl Send for ReportState
impl Sync for ReportState
impl Unpin for ReportState
impl UnsafeUnpin for ReportState
impl UnwindSafe for ReportState
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