pub trait FreyaPlugin {
// Required methods
fn plugin_id(&self) -> &'static str;
fn on_event(&mut self, event: &mut PluginEvent<'_>, handle: PluginHandle);
// Provided method
fn root_component(&self, root: Element) -> Element { ... }
}Expand description
Skeleton for Freya plugins.
Required Methods§
Sourcefn on_event(&mut self, event: &mut PluginEvent<'_>, handle: PluginHandle)
fn on_event(&mut self, event: &mut PluginEvent<'_>, handle: PluginHandle)
React on events emitted by Freya.
Provided Methods§
Sourcefn root_component(&self, root: Element) -> Element
fn root_component(&self, root: Element) -> Element
Wrap the root element with a custom component. Called during window creation. The default implementation returns the element unchanged.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".