Skip to main content

nautilus_plugin

Macro nautilus_plugin 

Source
macro_rules! nautilus_plugin {
    (
        $(name: $name:expr,)?
        $(vendor: $vendor:expr,)?
        $(version: $version:expr,)?
        $(custom_data: [$($cd:ty),* $(,)?] ,)?
        $(actors: [$($act:ty),* $(,)?] ,)?
        $(strategies: [$($strategy:ty),* $(,)?] ,)?
        $(controllers: [$($controller:ty),* $(,)?] ,)?
    ) => { ... };
}
Expand description

Defines a plug-in’s static manifest and emits the nautilus_plugin_init entry symbol.

Use this exactly once per plug-in cdylib, at module scope (typically in lib.rs).

§Required fields

  • name: short machine-readable plug-in name.
  • version: plug-in version string (usually env!("CARGO_PKG_VERSION")).

§Optional fields

§Example

use nautilus_plugin::prelude::*;

pub struct MyTick { ts_event: u64, ts_init: u64, value: f64 }

impl PluginCustomData for MyTick {
    const TYPE_NAME: &'static str = "MyTick";
    fn ts_event(&self) -> u64 { self.ts_event }
    fn ts_init(&self) -> u64 { self.ts_init }
    // ... other methods
}

nautilus_plugin::nautilus_plugin! {
    name: "my-plugin",
    version: env!("CARGO_PKG_VERSION"),
    custom_data: [MyTick],
}