MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / trigger

Method trigger

crates/opencode-plugin/src/lib.rs:187–202  ·  view source on GitHub ↗
(&self, context: HookContext)

Source from the content-addressed store, hash-verified

185 }
186
187 pub async fn trigger(&self, context: HookContext) -> Vec<HookResult> {
188 let hooks = self.hooks.read().await;
189 let mut results = Vec::new();
190
191 if let Some(hook_list) = hooks.get(&context.event) {
192 for hook in hook_list {
193 if !hook.enabled {
194 continue;
195 }
196 let result = (hook.handler)(context.clone()).await;
197 results.push(result);
198 }
199 }
200
201 results
202 }
203
204 pub async fn remove(&self, event: &HookEvent, name: &str) -> bool {
205 let mut hooks = self.hooks.write().await;

Callers 4

triggerFunction · 0.80
trigger_collectFunction · 0.80

Calls 4

newFunction · 0.85
readMethod · 0.80
getMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected