Plugin

Trait Plugin 

Source
pub trait Plugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn version(&self) -> &str;
    fn description(&self) -> &str;
    fn initialize(&mut self, context: &mut PluginContext) -> Result<()>;
    fn handle_hook(
        &mut self,
        hook: PluginHook,
        context: &mut PluginContext,
    ) -> Result<()>;
    fn get_config_schema(&self) -> Option<Value>;
    fn validate_config(&self, config: &Value) -> Result<()>;
}
Expand description

Plugin trait that all plugins must implement

Required Methods§

Source

fn name(&self) -> &str

Get the plugin name

Source

fn version(&self) -> &str

Get the plugin version

Source

fn description(&self) -> &str

Get the plugin description

Source

fn initialize(&mut self, context: &mut PluginContext) -> Result<()>

Initialize the plugin

Source

fn handle_hook( &mut self, hook: PluginHook, context: &mut PluginContext, ) -> Result<()>

Handle plugin hooks

Source

fn get_config_schema(&self) -> Option<Value>

Get plugin configuration schema

Source

fn validate_config(&self, config: &Value) -> Result<()>

Validate plugin configuration

Implementors§