pub enum InboundEvent {
SystemInit {
session_id: String,
},
Assistant(Value),
StreamEvent(Value),
User(Value),
Other(Value),
}Expand description
A classified inbound event broadcast to DuplexSession::subscribe
receivers.
Every non-result message coming back from the CLI is broadcast as
one of these variants. The closing {"type": "result"} message is
not broadcast; it resolves the in-flight DuplexSession::send
future and lands in TurnResult::result.
Subscribers see the same set of events that accumulate in
TurnResult::events, in the same order, just classified. Adding
a typed accessor for a new event type later (e.g. promoting a
system subtype into its own variant) is non-breaking against the
Other fallback.
Variants§
SystemInit
First {"type": "system", "subtype": "init"} event for the
session. Carries the CLI-assigned session_id.
Assistant(Value)
{"type": "assistant", ...} – either a complete assistant
message or, in stream-json mode, a partial chunk.
StreamEvent(Value)
{"type": "stream_event", ...} – low-level streaming event
emitted while a turn is in progress.
User(Value)
{"type": "user", ...} – typically a tool result echo from
the CLI side.
Other(Value)
Any other event type, including non-init system events
and any message types not yet recognised by this enum.
Trait Implementations§
Source§impl Clone for InboundEvent
impl Clone for InboundEvent
Source§fn clone(&self) -> InboundEvent
fn clone(&self) -> InboundEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more