pub struct BackendContext<'a> {
pub message: &'a str,
pub event_tx: &'a Sender<AgentEvent>,
pub project_path: Option<&'a PathBuf>,
pub skills: &'a [Skill],
pub config: &'a Config,
pub model: &'a str,
pub session_mgr: &'a mut Option<SessionManager>,
pub memory_storage: &'a mut Option<MemoryStorage>,
pub agent: &'a mut Agent,
pub provider: &'a dyn Provider,
pub watcher_handle: Option<&'a Arc<Mutex<Option<JoinHandle<()>>>>>,
pub cancel_token: Option<&'a CancellationToken>,
}Expand description
后端命令执行上下文
包含命令执行所需的所有共享依赖。 使用生命周期避免不必要的克隆。
Fields§
§message: &'a str原始消息内容
event_tx: &'a Sender<AgentEvent>事件发送通道
project_path: Option<&'a PathBuf>项目路径
skills: &'a [Skill]可用技能列表
config: &'a Config配置
model: &'a str当前模型
session_mgr: &'a mut Option<SessionManager>会话管理器
memory_storage: &'a mut Option<MemoryStorage>记忆存储
agent: &'a mut AgentAgent 实例
provider: &'a dyn ProviderProvider 实例
watcher_handle: Option<&'a Arc<Mutex<Option<JoinHandle<()>>>>>文件监控句柄(可选)
cancel_token: Option<&'a CancellationToken>取消令牌(可选)
Auto Trait Implementations§
impl<'a> Freeze for BackendContext<'a>
impl<'a> !RefUnwindSafe for BackendContext<'a>
impl<'a> Send for BackendContext<'a>
impl<'a> Sync for BackendContext<'a>
impl<'a> Unpin for BackendContext<'a>
impl<'a> UnsafeUnpin for BackendContext<'a>
impl<'a> !UnwindSafe for BackendContext<'a>
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