Skip to main content

export_plugin

Macro export_plugin 

Source
macro_rules! export_plugin {
    ($register:path) => { ... };
    ($register:path, requires = [$(($id:literal, $req:literal)),* $(,)?]) => { ... };
}
Expand description

Exports the plugin stuff.

ⓘ
use slowshell_plugin_abi::prelude::*;

struct Hello;
impl Component for Hello {
  fn new(_ctx: &Context<'_>) -> Self { Hello }
  fn view(&self, _ctx: &Context<'_>) -> Node { Node::text("hello") }
}

fn register(host: HostRef<'_>) {
  host.component::<Hello>("example/hello");
}

export_plugin!(register);
ⓘ
export_plugin!(register, requires = [("other-plugin", "^0.2")]);