pub enum RunEvent {
Started {
run_id: i64,
total_steps: u64,
},
Step {
run_id: i64,
index: u64,
step_type: String,
status: String,
},
Progress {
run_id: i64,
completed: u64,
total: u64,
},
Finished {
run_id: i64,
status: String,
},
Error {
run_id: i64,
message: String,
},
Unknown(Value),
}Expand description
One frame of the GET /v1/runs/:id/events SSE stream
(engine/events.rs::RunEvent, tagged on "event", snake_case).
Finished and Error are stream-closing. Unrecognized frames (a future daemon
vocabulary) decode as RunEvent::Unknown instead of failing.
Variants§
Started
The run is registered and about to drive its steps.
Step
A step transitioned; status ∈ running|succeeded|failed|skipped (open set).
Progress
Coarse progress hint.
Finished
Terminal: final status (success | failed | cancelled | timeout | captcha_required | twofa_required, open set). Stream-closing.
Error
Terminal: the run failed around the step loop. Stream-closing.
Unknown(Value)
A frame this SDK version does not recognize (raw payload preserved).
Implementations§
Source§impl RunEvent
impl RunEvent
Sourcepub fn parse(data: &str) -> RunEvent
pub fn parse(data: &str) -> RunEvent
Parse one SSE data: payload. Never fails: unparseable/unknown frames become
RunEvent::Unknown (with the raw text wrapped as a JSON string when the
payload is not even JSON).
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
True for the two stream-closing variants (Finished / Error).