Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Send {
Show 34 methods // Required methods fn plugin_id(&self) -> &str; fn plugin_version(&self) -> String; fn server_info(&self) -> ServerInfo; // Provided methods fn capabilities(&self) -> Vec<String> { ... } fn manifest(&self) -> Option<PluginManifest> { ... } fn initialize<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: PluginInitializeRequest, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_initialized<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn health<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn list_tools<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListToolsResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn call_tool<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: ToolCallRequest, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<CallToolResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn list_prompts<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListPromptsResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn get_prompt<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: GetPromptRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<GetPromptResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn list_resources<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListResourcesResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn read_resource<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: ReadResourceRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ReadResourceResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn list_resource_templates<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListResourceTemplatesResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn subscribe_resource<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: SubscribeRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<()>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn unsubscribe_resource<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: UnsubscribeRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<()>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn complete<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: CompleteRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<CompleteResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn set_log_level<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: SetLevelRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<()>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn list_tasks<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListTasksResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn get_task_info<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: GetTaskInfoParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<GetTaskResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn get_task_result<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: GetTaskResultParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<GetTaskPayloadResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn cancel_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: CancelTaskParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<CancelTaskResult>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn invoke_service<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, request: InvokeServiceRequest, context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<InvokeServiceResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn handle_rpc<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, request: RpcRequest, context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginRpcResult> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_rpc_notification<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _notification: RpcNotification, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_channel_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _message: ChannelMessage, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_bulk_transfer_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _message: BulkTransferMessage, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_mesh_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _event: MeshEvent, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn open_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: OpenStreamRequest, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<OpenStreamResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_cancel_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _notification: CancelStreamNotification, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_close_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _notification: CloseStreamNotification, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_stream_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _error: StreamError, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn on_host_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, error: ErrorResponse, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... }
}

Required Methods§

Provided Methods§

Source

fn capabilities(&self) -> Vec<String>

Source

fn manifest(&self) -> Option<PluginManifest>

Source

fn initialize<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: PluginInitializeRequest, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_initialized<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn health<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_tools<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListToolsResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn call_tool<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: ToolCallRequest, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<CallToolResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_prompts<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListPromptsResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_prompt<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: GetPromptRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<GetPromptResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_resources<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListResourcesResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn read_resource<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: ReadResourceRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ReadResourceResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_resource_templates<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListResourceTemplatesResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn subscribe_resource<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: SubscribeRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<()>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn unsubscribe_resource<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: UnsubscribeRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<()>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn complete<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: CompleteRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<CompleteResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn set_log_level<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: SetLevelRequestParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<()>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn list_tasks<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: Option<PaginatedRequestParams>, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<ListTasksResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_task_info<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: GetTaskInfoParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<GetTaskResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_task_result<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: GetTaskResultParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<GetTaskPayloadResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn cancel_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: CancelTaskParams, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<CancelTaskResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn invoke_service<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, request: InvokeServiceRequest, context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<InvokeServiceResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn handle_rpc<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, request: RpcRequest, context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginRpcResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_rpc_notification<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _notification: RpcNotification, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_channel_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _message: ChannelMessage, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_bulk_transfer_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _message: BulkTransferMessage, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_mesh_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _event: MeshEvent, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn open_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _request: OpenStreamRequest, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = PluginResult<Option<OpenStreamResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_cancel_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _notification: CancelStreamNotification, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_close_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _notification: CloseStreamNotification, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_stream_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, _error: StreamError, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_host_error<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, error: ErrorResponse, _context: &'life1 mut PluginContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§