Skip to main content

host_init

Function host_init 

Source
pub fn host_init(
    plugin: &dyn LinsightPlugin,
    ctx: &PluginCtx,
) -> Result<PluginManifest, PluginError>
Expand description

Convenience wrapper: call plugin.init(&ctx) with a host-side PluginCtx and get a host-side PluginManifest back.

Validates every sensor descriptor’s ID via SensorId::try_new before returning. The From<RSensorId> for SensorId conversion uses the infallible SensorId::new (which only debug_assert!s on invariants); without this check, a release-mode plugin returning an empty or whitespace-bearing ID would silently corrupt the daemon’s registry.