Trait Plugin

Source
pub trait Plugin: Sized + 'static {
    type StartArgs: PluginStartArgs;
    type Instance: PluginInstance;

    const DEFAULT_NAME: &'static str;
    const PLUGIN_VERSION: &'static str;
    const PLUGIN_LONG_VERSION: &'static str;

    // Required method
    fn start(name: &str, args: &Self::StartArgs) -> ZResult<Self::Instance>;
}
Expand description

Base plugin trait. The loaded plugin

Required Associated Constants§

Source

const DEFAULT_NAME: &'static str

Plugins’ default name when statically linked.

Source

const PLUGIN_VERSION: &'static str

Plugin’s version. Used only for information purposes. It’s recommended to use plugin_version! macro to generate this string.

Source

const PLUGIN_LONG_VERSION: &'static str

Plugin’s long version (with git commit hash). Used only for information purposes. It’s recommended to use plugin_version! macro to generate this string.

Required Associated Types§

Required Methods§

Source

fn start(name: &str, args: &Self::StartArgs) -> ZResult<Self::Instance>

Starts your plugin. Use Ok to return your plugin’s control structure

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§