pub trait Plugin: Send + Sync {
// Required methods
fn manifest(&self) -> &PluginManifest;
fn initialize(&mut self, config: &HashMap<String, String>) -> Result<()>;
fn execute(&mut self, input: &str) -> Result<PluginResult>;
fn shutdown(&mut self) -> Result<()>;
}Expand description
Trait that all plugins must implement (host-side representation).
Required Methods§
Sourcefn manifest(&self) -> &PluginManifest
fn manifest(&self) -> &PluginManifest
Return the plugin’s manifest.
Sourcefn initialize(&mut self, config: &HashMap<String, String>) -> Result<()>
fn initialize(&mut self, config: &HashMap<String, String>) -> Result<()>
Initialize the plugin with the given configuration.
Sourcefn execute(&mut self, input: &str) -> Result<PluginResult>
fn execute(&mut self, input: &str) -> Result<PluginResult>
Execute the plugin’s main function with the given input.