Expand description
§ewwii_plugin_api - A plugin interface for ewwii
ewwii_plguin_api
is a shared list of traits
that both ewwii and its plugins can use.
This crate simplifies and provides a safe way for building
plugins for ewwii.
§Example
The following example shows how this crate shall be used to build ewwii plugins:
use ewwii_plugin_api::{EwwiiAPI, Plugin, export_plugin};
pub struct DummyStructure;
impl Plugin for DummyStructure {
// critical for ewwii to launch the plugin
fn init(&self, host: &dyn EwwiiAPI) {
// will be printed by the host
host.log("Plugin says Hello!");
}
}
// Critical for ewwii to load the plugin
export_plugin!(DummyStructure);
Re-exports§
Modules§
- example
- A module providing example implementations of plugins
- widget_
backend - Module exposing structures and types from the Widget rendering and definition backend in ewwii.
Macros§
- auto_
plugin - Macro to implement and export a plugin in a single step. With this macro, users can write their plugin code directly without having to manually implement each trait.
- export_
plugin - Automatically implements
create_plugin
for a given fieldless structure - export_
stateful_ plugin - Automatically implements
create_plugin
for a given structure that has fields.