pub enum ServerMessage {
Show 18 variants
Hello(ServerHello),
History(History),
Shutdown(Shutdown),
Ping(Ping),
CommandOutput(CommandOutput),
Error(Error),
StreamStart(StreamStart),
StreamChunk(StreamChunk),
StreamEnd(StreamEnd),
Phase(Phase),
NewMessage(NewMessage),
ToolCall(ToolCall),
ToolResult(ToolResult),
SendImage(SendImage),
CacheWarning(CacheWarning),
ProviderFallbackWarning(ProviderFallbackWarning),
UsageWarning(UsageWarning),
Unknown,
}Expand description
All server → client message types, tagged by “type”.
Variants§
Hello(ServerHello)
History(History)
Shutdown(Shutdown)
Ping(Ping)
CommandOutput(CommandOutput)
Error(Error)
StreamStart(StreamStart)
StreamChunk(StreamChunk)
StreamEnd(StreamEnd)
Phase(Phase)
NewMessage(NewMessage)
ToolCall(ToolCall)
ToolResult(ToolResult)
SendImage(SendImage)
CacheWarning(CacheWarning)
ProviderFallbackWarning(ProviderFallbackWarning)
UsageWarning(UsageWarning)
Unknown
A frame whose type tag matches no known variant. Produced only by
deserialization (never constructed or sent by the server), so a client
built against an older protocol skips message types added by a newer
daemon instead of erroring the connection. Clients should treat this as
a benign no-op. Re-serializing it is lossy and must be avoided.
Implementations§
Source§impl ServerMessage
impl ServerMessage
Sourcepub fn with_rid(self, rid: Option<String>) -> Self
pub fn with_rid(self, rid: Option<String>) -> Self
Attach a request ID to request-scoped responses.
Unsolicited push/broadcast messages intentionally ignore rid.
Sourcepub fn subagent(&self) -> Option<&str>
pub fn subagent(&self) -> Option<&str>
The sub-agent name tagged on this frame, if any. None is primary-model
(or non-stream) activity. Lets clients bracket nested ask_<name> output
by watching the tag transition on/off.
Sourcepub fn set_subagent(&mut self, name: &str)
pub fn set_subagent(&mut self, name: &str)
Tag a stream/tool frame as belonging to a sub-agent’s nested loop.
Used by the sub-agent forwarder to attribute the messages it relays from
an ask_<name> loop, so clients render them as nested activity. Frame
types that a sub-agent loop never emits are left untouched.
Trait Implementations§
Source§impl Clone for ServerMessage
impl Clone for ServerMessage
Source§fn clone(&self) -> ServerMessage
fn clone(&self) -> ServerMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more