Skip to main content

declare_plugin

Macro declare_plugin 

Source
macro_rules! declare_plugin {
    ($manifest:expr, $init:expr) => { ... };
}
Expand description

Re-export nemo-plugin-api for convenience Macro to declare a plugin entry point.

Generates two extern "C" functions:

  • nemo_plugin_manifest() -> PluginManifest — returns the plugin descriptor
  • nemo_plugin_entry(registrar: &mut dyn PluginRegistrar) — called to register capabilities

§Example

declare_plugin!(
    PluginManifest::new("hello", "Hello Plugin", Version::new(1, 0, 0))
        .with_description("Greets the user"),
    |registrar: &mut dyn PluginRegistrar| {
        registrar.context().log(LogLevel::Info, "Hello from plugin!");
    }
);