Skip to main content

FreyaPlugin

Trait FreyaPlugin 

Source
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§

Source

fn plugin_id(&self) -> &'static str

Unique identifier for this plugin. Used for deduplication.

Source

fn on_event(&mut self, event: &mut PluginEvent<'_>, handle: PluginHandle)

React on events emitted by Freya.

Provided Methods§

Source

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".

Implementors§