pub trait Plugin: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn description(&self) -> &str;
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn configure<'life0, 'async_trait>(
&'life0 mut self,
config: Value,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn capabilities(&self) -> PluginCapabilities;
fn metadata(&self) -> PluginMetadata;
}Expand description
Main plugin trait that all plugins must implement
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the plugin description
Sourcefn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the plugin
Sourcefn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shutdown the plugin
Sourcefn configure<'life0, 'async_trait>(
&'life0 mut self,
config: Value,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn configure<'life0, 'async_trait>(
&'life0 mut self,
config: Value,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Configure the plugin with custom settings
Sourcefn capabilities(&self) -> PluginCapabilities
fn capabilities(&self) -> PluginCapabilities
Get the plugin capabilities
Sourcefn metadata(&self) -> PluginMetadata
fn metadata(&self) -> PluginMetadata
Get plugin metadata
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".