pub enum WsOutbound {
Show 24 variants
StreamChunk {
content: String,
},
Message {
role: String,
content: String,
},
ToolConfirmRequest {
tools: Vec<ToolConfirmInfo>,
},
AskRequest {
questions: Vec<AskQuestionInfo>,
},
ToolCall {
id: String,
name: String,
arguments: String,
},
ToolResult {
id: String,
name: String,
output: String,
is_error: bool,
},
Status {
state: String,
},
SessionSync {
messages: Vec<SyncMessage>,
status: String,
model: String,
context_tokens: usize,
message_count: usize,
auto_approve: bool,
},
Pong,
ServerHello {
server_pk: String,
},
KeyExchangeOk,
Error {
message: String,
},
SessionList {
sessions: Vec<SessionMeta>,
},
SessionSwitched {
session_id: String,
},
ModelList {
models: Vec<ModelInfo>,
active_index: usize,
},
ThemeList {
themes: Vec<ThemeInfo>,
active_index: usize,
},
ConfigData {
tab: String,
fields: Vec<ConfigField>,
},
ArchiveList {
archives: Vec<ArchiveInfo>,
},
AgentPermRequest {
agent_name: String,
tool_name: String,
arguments: String,
},
PlanApprovalRequest {
agent_name: String,
plan_summary: String,
},
FileListResult {
path: String,
entries: Vec<FileEntry>,
},
FileReadResult {
path: String,
content: String,
error: Option<String>,
},
FileWriteResult {
path: String,
success: bool,
error: Option<String>,
},
TerminalOutput {
output: String,
exit_code: Option<i32>,
},
}Expand description
服务端 → 客户端 消息
Variants§
StreamChunk
流式文本块
Message
完整消息(流结束后或用户消息)
ToolConfirmRequest
工具确认请求
Fields
§
tools: Vec<ToolConfirmInfo>AskRequest
Ask 工具提问请求
Fields
§
questions: Vec<AskQuestionInfo>ToolCall
工具开始执行
ToolResult
工具执行结果
Status
状态变化
SessionSync
全量状态同步
Fields
§
messages: Vec<SyncMessage>Pong
心跳 pong
ServerHello
ECDH 密钥协商:服务端发送公钥
KeyExchangeOk
ECDH 密钥协商成功确认
Error
错误消息
SessionList
会话列表
Fields
§
sessions: Vec<SessionMeta>SessionSwitched
会话已切换
ModelList
模型列表
ThemeList
主题列表
ConfigData
配置数据
ArchiveList
归档列表
Fields
§
archives: Vec<ArchiveInfo>AgentPermRequest
Agent 权限确认请求
PlanApprovalRequest
Plan 审批请求
FileListResult
目录列表结果
FileReadResult
文件内容结果
FileWriteResult
文件写入结果
TerminalOutput
终端命令输出
Trait Implementations§
Source§impl Clone for WsOutbound
impl Clone for WsOutbound
Source§fn clone(&self) -> WsOutbound
fn clone(&self) -> WsOutbound
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 WsOutbound
impl Debug for WsOutbound
Auto Trait Implementations§
impl Freeze for WsOutbound
impl RefUnwindSafe for WsOutbound
impl Send for WsOutbound
impl Sync for WsOutbound
impl Unpin for WsOutbound
impl UnsafeUnpin for WsOutbound
impl UnwindSafe for WsOutbound
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.