pub trait Plugin: Send + Sync {
// Required methods
fn metadata(&self) -> PluginMetadata;
fn on_load<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_unload<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn tools(&self) -> Vec<PluginToolDef> { ... }
fn hooks(&self) -> Vec<(HookPoint, Box<dyn Hook>)> { ... }
}Expand description
The Plugin trait that all plugins must implement.
Required Methods§
Sourcefn metadata(&self) -> PluginMetadata
fn metadata(&self) -> PluginMetadata
Get plugin metadata.
Provided Methods§
Sourcefn tools(&self) -> Vec<PluginToolDef>
fn tools(&self) -> Vec<PluginToolDef>
Return tool definitions provided by this plugin.