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§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the plugin description
Sourcefn initialize(&mut self, context: &mut PluginContext) -> Result<()>
fn initialize(&mut self, context: &mut PluginContext) -> Result<()>
Initialize the plugin
Sourcefn handle_hook(
&mut self,
hook: PluginHook,
context: &mut PluginContext,
) -> Result<()>
fn handle_hook( &mut self, hook: PluginHook, context: &mut PluginContext, ) -> Result<()>
Handle plugin hooks
Sourcefn get_config_schema(&self) -> Option<Value>
fn get_config_schema(&self) -> Option<Value>
Get plugin configuration schema
Sourcefn validate_config(&self, config: &Value) -> Result<()>
fn validate_config(&self, config: &Value) -> Result<()>
Validate plugin configuration