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).
Structs
Section titled “Structs”struct HostImportEntry
Section titled “struct HostImportEntry”pub
A submitted host-import descriptor pointer, collected via inventory.
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
descriptor |
&'static HostImportDescriptor |
Functions
Section titled “Functions”fn get_host_import_registry
Section titled “fn get_host_import_registry”pub
fn get_host_import_registry() -> &'static HostImportRegistryGet 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)}