Skip to content

fidius-core::host_registry

Rust

Host-import registry assembly (plugin → host callback channel).

Each #[fidius::host_interface] trait submits a HostImportDescriptor pointer via inventory::submit! (from the interface crate, gated to non-wasm builds). fidius_plugin_registry!() emits the optional fidius_get_host_imports export that collects them, so a plugin dylib that links a host interface automatically advertises it. Plugins with no host interfaces export an empty registry — and plugins built before this channel existed export no such symbol at all; the host treats both identically (nothing to bind).

pub

A submitted host-import descriptor pointer, collected via inventory.

Name Type Description
descriptor &'static HostImportDescriptor

pub

fn get_host_import_registry() -> &'static HostImportRegistry

Get or build the host-import registry (cached after first call).

Source
pub fn get_host_import_registry() -> &'static HostImportRegistry {
static REGISTRY: std::sync::OnceLock<HostImportRegistry> = std::sync::OnceLock::new();
REGISTRY.get_or_init(build_host_import_registry)
}