pub enum StreamMsg {
Chunk,
ToolCallRequest(Vec<ToolCallItem>),
Done,
Error(ChatError),
Cancelled,
Retrying {
attempt: u32,
max_attempts: u32,
delay_ms: u64,
error: String,
},
Compacting,
Compacted {
messages_before: usize,
},
}Expand description
后台线程发送给 TUI 的消息类型
Variants§
Chunk
收到一个流式文本块
ToolCallRequest(Vec<ToolCallItem>)
LLM 请求执行工具(附带完整工具调用列表)
Done
流式响应完成
Error(ChatError)
发生错误
Cancelled
用户主动取消
Retrying
正在重试(网络波动等可恢复错误)
Fields
Compacting
上下文正在压缩(auto_compact 执行中)
Compacted
上下文压缩完成(携带压缩前的消息数量,供 UI 展示)
Auto Trait Implementations§
impl Freeze for StreamMsg
impl RefUnwindSafe for StreamMsg
impl Send for StreamMsg
impl Sync for StreamMsg
impl Unpin for StreamMsg
impl UnsafeUnpin for StreamMsg
impl UnwindSafe for StreamMsg
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> 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.