MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / with_switch_agent

Method with_switch_agent

crates/opencode-tool/src/tool.rs:405–414  ·  view source on GitHub ↗
(mut self, callback: F)

Source from the content-addressed store, hash-verified

403 }
404
405 pub fn with_switch_agent<F, Fut>(mut self, callback: F) -> Self
406 where
407 F: Fn(String, Option<String>) -> Fut + Send + Sync + 'static,
408 Fut: std::future::Future<Output = Result<(), ToolError>> + Send + 'static,
409 {
410 self.switch_agent = Some(Arc::new(move |agent, model| {
411 Box::pin(callback(agent, model))
412 }));
413 self
414 }
415
416 pub async fn do_switch_agent(
417 &self,

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected