MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / lookup_plugin

Function lookup_plugin

crates/core/src/plugin.rs:843–849  ·  view source on GitHub ↗

Looks up a registered plugin by kind. # Parameters - `plugin_kind`: Plugin kind to resolve. # Returns The registered plugin implementation for `plugin_kind`, or `None` when the kind is unknown. # Notes The returned plugin is shared by [`Arc`], so callers receive a cheap clone.

(plugin_kind: &str)

Source from the content-addressed store, hash-verified

841/// # Notes
842/// The returned plugin is shared by [`Arc`], so callers receive a cheap clone.
843pub fn lookup_plugin(plugin_kind: &str) -> Option<Arc<dyn Plugin>> {
844 let _ = ensure_builtin_plugins_registered();
845 PLUGIN_HANDLERS
846 .read()
847 .ok()
848 .and_then(|guard| guard.get(plugin_kind).cloned())
849}
850
851/// Validates a plugin configuration document.
852///

Callers 4

validate_plugin_configFunction · 0.85

Calls 3

okMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected