pub struct RegisteredHandler {
pub plugin: String,
pub priority: i32,
pub platforms: Vec<String>,
pub handler: EventHandlerFn,
pub user_data: *mut c_void,
}Expand description
A registered on(tag) event handler. user_data is the plugin’s opaque
context, passed back unchanged on every dispatch. plugin is the display
name of the owning extension (host-side only — stamped from the cdylib path
at registration; not part of the ABI), used for lifecycle veto diagnostics
(“extension foo aborted before_tui_start”).
priority/platforms are the owning plugin’s declaration (P2): the
snapshot sorts handlers by priority (smaller first, stable), and dispatch
skips a handler whose non-empty platforms excludes the host platform.
Both default to 100 / empty (all platforms); a plugin sets them via the
unified C ABI declare callback.
SAFETY contract: the plugin guarantees handler is safe to call from any
thread (the host dispatches from the async emitter thread) and user_data
is valid for the registry’s lifetime. The host never frees user_data
(plugin-owned).
Fields§
§plugin: StringDisplay name of the owning extension (from the cdylib file stem).
priority: i32Dispatch order (smaller runs first). Default 100.
platforms: Vec<String>Platforms this handler’s plugin supports (empty = all). Matched against
current_platform.
handler: EventHandlerFn§user_data: *mut c_void