pub enum PluginEvent {
Call {
event: String,
key: String,
fallback: String,
args: Vec<ScriptValue>,
},
Commands(Vec<ScriptCommand>),
}Expand description
Something a plugin or a capability pushes at the engine outside a call.
This is the direction a worker thread uses: a plugin that watches a file,
polls a device, or waits on a socket delivers what it found without being
asked. The bytes cross the plugin boundary onto
lumen_core::plugin_events, and the script layer’s per-tick drain
decodes them here and routes each one
(crate::runtime::collect_plugin_events).
A system on the main thread writes one as a message instead
(MessageWriter<PluginEvent>, registered by
crate::runtime::register_plugin_event_message); ordered before
crate::runtime::collect_plugin_events, it is delivered on the tick it
was written. That is how an OS capability (a tray click, a global hotkey,
a resolved file dialog) reaches the script without the core naming it.
Variants§
Call
Call a handler in the app’s script.
Fields
key: StringIdentifier the handler receives as its first argument, so one
handler can serve several sources; a per-key
on(event, key, fn) registration wins over the fallback.
args: Vec<ScriptValue>Arguments for the handler, after the key.
Commands(Vec<ScriptCommand>)
Apply commands, as if a call had emitted them.
Trait Implementations§
Source§impl Clone for PluginEvent
impl Clone for PluginEvent
Source§fn clone(&self) -> PluginEvent
fn clone(&self) -> PluginEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more