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

Method with_prompt_subsession

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

Source from the content-addressed store, hash-verified

451 }
452
453 pub fn with_prompt_subsession<F, Fut>(mut self, callback: F) -> Self
454 where
455 F: Fn(String, String) -> Fut + Send + Sync + 'static,
456 Fut: std::future::Future<Output = Result<String, ToolError>> + Send + 'static,
457 {
458 self.prompt_subsession = Some(Arc::new(move |session_id, prompt| {
459 Box::pin(callback(session_id, prompt))
460 }));
461 self
462 }
463
464 pub async fn do_prompt_subsession(
465 &self,

Calls 1

newFunction · 0.85

Tested by

no test coverage detected