[][src]Trait collectd_plugin::PluginManager

pub trait PluginManager {
    fn name() -> &'static str;
fn plugins(
        _config: Option<&[ConfigItem]>
    ) -> Result<PluginRegistration, Box<dyn Error>>; fn capabilities() -> PluginManagerCapabilities { ... }
fn initialize() -> Result<(), Box<dyn Error>> { ... } }

Defines the entry point for a collectd plugin. Based on collectd's configuration, a PluginManager will register any number of plugins (or return an error)

Required methods

fn name() -> &'static str

Name of the plugin. Must not contain null characters or panic.

fn plugins(
    _config: Option<&[ConfigItem]>
) -> Result<PluginRegistration, Box<dyn Error>>

Returns one or many instances of a plugin that is configured from collectd's configuration file. If parameter is None, a configuration section for the plugin was not found, so default values should be used.

Loading content...

Provided methods

fn capabilities() -> PluginManagerCapabilities

Defines the capabilities of the plugin manager. Must not panic.

fn initialize() -> Result<(), Box<dyn Error>>

Initialize any socket, files, or expensive resources that may have been parsed from the configuration. If an error is reported, all hooks registered will be unregistered. This is really only useful for PluginRegistration::Single modules who want global data.

Loading content...

Implementors

Loading content...