pub trait Plugin: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn description(&self) -> &str;
fn initialize(&mut self, config: &PluginConfig) -> Result<()>;
fn execute(&self, command: &str, args: &[String]) -> Result<()>;
fn commands(&self) -> Vec<PluginCommand>;
fn cleanup(&mut self) -> Result<()>;
}Expand description
Trait that all plugins must implement
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Returns a description of the plugin
Sourcefn initialize(&mut self, config: &PluginConfig) -> Result<()>
fn initialize(&mut self, config: &PluginConfig) -> Result<()>
Initializes the plugin with the given configuration
Sourcefn execute(&self, command: &str, args: &[String]) -> Result<()>
fn execute(&self, command: &str, args: &[String]) -> Result<()>
Executes a command provided by the plugin
Sourcefn commands(&self) -> Vec<PluginCommand>
fn commands(&self) -> Vec<PluginCommand>
Returns a list of commands provided by the plugin