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

Method with_publish_bus

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

Source from the content-addressed store, hash-verified

514 }
515
516 pub fn with_publish_bus<F, Fut>(mut self, callback: F) -> Self
517 where
518 F: Fn(String, serde_json::Value) -> Fut + Send + Sync + 'static,
519 Fut: std::future::Future<Output = ()> + Send + 'static,
520 {
521 self.publish_bus = Some(Arc::new(move |event_type, properties| {
522 Box::pin(callback(event_type, properties))
523 }));
524 self
525 }
526
527 pub async fn do_publish_bus(&self, event_type: &str, properties: serde_json::Value) {
528 if let Some(ref callback) = self.publish_bus {

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected