Skip to main content

Plugin

Trait Plugin 

Source
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§

Source

fn manifest(&self) -> &PluginManifest

Return the plugin’s manifest.

Source

fn initialize(&mut self, config: &HashMap<String, String>) -> Result<()>

Initialize the plugin with the given configuration.

Source

fn execute(&mut self, input: &str) -> Result<PluginResult>

Execute the plugin’s main function with the given input.

Source

fn shutdown(&mut self) -> Result<()>

Clean up resources held by the plugin.

Implementors§