pub enum StreamEvent {
Start {
command: String,
ts: String,
},
Step {
name: String,
status: StepStatus,
duration_ms: Option<u64>,
error: Option<String>,
ts: String,
},
Progress {
name: String,
percent: Option<u8>,
message: Option<String>,
ts: String,
},
Log {
level: LogLevel,
message: String,
ts: String,
},
Event {
name: String,
data: Value,
ts: String,
},
Result {
command: String,
timestamp: u64,
exit_code: i32,
schema_version: Option<String>,
result: Value,
next_actions: Vec<NextAction>,
},
Error {
command: String,
timestamp: u64,
exit_code: i32,
schema_version: Option<String>,
error: ErrorBody,
fix: String,
data: Option<Value>,
next_actions: Vec<NextAction>,
},
}Expand description
Typed NDJSON stream event.
Terminal variants (Result, Error) use custom serialization to inject
ok as a fixed boolean and always include timestamp (emitted as an
RFC 3339 UTC string). The ok field cannot be set incorrectly — it is
derived from the variant. The ts on non-terminal variants is
caller-supplied; use RFC 3339 UTC (2026-06-10T14:42:17Z) to match the
terminal events.
Variants§
Start
Step
Progress
Log
Event
Result
Fields
§
next_actions: Vec<NextAction>Error
Fields
§
data: Option<Value>The failure’s structured payload, mirroring
crate::ErrorEnvelope::data. The same failure must read the same
on both terminal channels: an agent that switched to NDJSON cannot
lose the facts the direct envelope would have handed it.
§
next_actions: Vec<NextAction>Implementations§
Source§impl StreamEvent
impl StreamEvent
pub fn result_from_envelope(envelope: SuccessEnvelope) -> Self
pub fn error_from_envelope(envelope: ErrorEnvelope) -> Self
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
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 StreamEvent
impl Debug for StreamEvent
Source§impl PartialEq for StreamEvent
impl PartialEq for StreamEvent
Source§impl Serialize for StreamEvent
impl Serialize for StreamEvent
impl StructuralPartialEq for StreamEvent
Auto Trait Implementations§
impl Freeze for StreamEvent
impl RefUnwindSafe for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnsafeUnpin for StreamEvent
impl UnwindSafe for StreamEvent
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