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

Method register

crates/opencode-tool/src/registry.rs:22–25  ·  view source on GitHub ↗
(&self, tool: T)

Source from the content-addressed store, hash-verified

20 }
21
22 pub async fn register<T: Tool + 'static>(&self, tool: T) {
23 let mut tools = self.tools.write().await;
24 tools.insert(tool.id().to_string(), Arc::new(tool));
25 }
26
27 pub async fn get(&self, id: &str) -> Option<Arc<dyn Tool>> {
28 let tools = self.tools.read().await;

Callers 1

create_default_registryFunction · 0.45

Calls 2

newFunction · 0.85
idMethod · 0.45

Tested by

no test coverage detected