1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Global registry of statically-bundled plugin vtables.
//!
//! The plugin loader in this crate (`NativePluginLoader`,
//! `load_registered_plugin`) only knows how to load plugins from
//! dynamic libraries. Statically-bundled plugins live inside the
//! final CLI binary and are not discoverable via filesystem scans.
//!
//! This registry bridges the gap: at startup the CLI registers every
//! statically-bundled plugin's [`StaticPluginVtable`] (keyed by
//! plugin id). When a plugin-to-plugin `call_service_raw` path tries
//! to dispatch to a bundled plugin, it consults this registry and
//! uses [`load_static_plugin`](crate::load_static_plugin) rather
//! than trying to `dlopen` a non-existent dynamic library.
use StaticPluginVtable;
use BTreeMap;
use ;
static REGISTRY: = new;
/// Register a statically-bundled plugin's vtable keyed by its manifest
/// plugin id. Idempotent: re-registering an id overwrites the prior
/// entry (used by tests that reload the CLI process in-place).
/// Look up a registered static vtable by plugin id. Returns `None`
/// when no statically-bundled plugin with that id is known (the
/// caller should fall back to the dynamic-library load path).