pub struct WorkObservation {
pub work: WorkRef,
pub revision: u64,
pub state: WorkState,
pub paused: Option<PausePoint>,
pub finished: Option<FinishedKind>,
pub fault: Option<String>,
}Expand description
A snapshot of one work’s published state.
The revision increments on every observable state change, so a caller can tell a fresh snapshot from a stale one without holding the session lock.
Fields§
§work: WorkRefThe observed work.
revision: u64Monotonic revision of this work’s published state, starting at 0 for
Accepted.
state: WorkStateThe current management state.
paused: Option<PausePoint>Why the work paused, including the hook-prepared calls awaiting a
decision. Present exactly when state is WorkState::Paused.
This is an owned copy from the same observation as revision;
changing it does not change the retained pause. Use its awaiting
calls to construct a crate::resume::ResumeRequest and pass this
revision to resume, which rejects decisions for an older pause.
finished: Option<FinishedKind>The terminal result when state is WorkState::Finished; None
otherwise.
fault: Option<String>The fault reason when state is WorkState::Faulted; None
otherwise.
Trait Implementations§
Source§impl Clone for WorkObservation
impl Clone for WorkObservation
Source§fn clone(&self) -> WorkObservation
fn clone(&self) -> WorkObservation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more