Source Events ↗

plugin.loaded

A plugin finished initializing.

When
Immediately after that plugin's init returns 0.
Payload
UTF-8 bytes of the plugin name from its descriptor.
Cancelable
No

Only plugins loaded earlier can observe later plugin.loaded events.

Use cases

  • Cross-plugin diagnostics
  • Log plugin inventory

Example

Registration and handler

Register

hook!(host, PluginEvent::PluginLoaded, on_plugin_loaded);

Handler

extern "C" fn on_event(ctx: *const EventContext) -> HookResult {
    let ctx = unsafe { &*ctx };
    let payload = unsafe { std::slice::from_raw_parts(ctx.payload_ptr, ctx.payload_len) };
    let _json = std::str::from_utf8(payload).unwrap_or_default();
    HookResult::r#continue()
}

← All lifecycle events