Skip to content

fidius-core::registry

Rust

Plugin registry assembly for multi-plugin dylibs.

Each #[plugin_impl] submits its PluginDescriptor pointer via inventory::submit!. Plugin crates call fidius_plugin_registry!() once in their lib.rs to emit the fidius_get_registry export function that the host calls via dlsym.

pub

A submitted descriptor pointer. Used with inventory for distributed collection.

Name Type Description
descriptor &'static PluginDescriptor

pub

fn get_registry() -> &'static PluginRegistry

Get or build the plugin registry.

Returns a 'static reference to the registry. Built on first call, cached for subsequent calls.

Source
pub fn get_registry() -> &'static PluginRegistry {
static REGISTRY: std::sync::OnceLock<PluginRegistry> = std::sync::OnceLock::new();
REGISTRY.get_or_init(build_registry)
}