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

Method with_ask

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

Source from the content-addressed store, hash-verified

364 }
365
366 pub fn with_ask<F, Fut>(mut self, callback: F) -> Self
367 where
368 F: Fn(PermissionRequest) -> Fut + Send + Sync + 'static,
369 Fut: std::future::Future<Output = Result<(), ToolError>> + Send + 'static,
370 {
371 self.ask = Some(Arc::new(move |req| Box::pin(callback(req))));
372 self
373 }
374
375 pub async fn ask_permission(&self, request: PermissionRequest) -> Result<(), ToolError> {
376 if let Some(ref callback) = self.ask {

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected