pub struct SimplePlugin { /* private fields */ }Implementations§
Source§impl SimplePlugin
impl SimplePlugin
pub fn new(metadata: PluginMetadata) -> Self
pub fn with_capabilities(self, capabilities: Vec<String>) -> Self
pub fn with_manifest(self, manifest: PluginManifest) -> Self
pub fn with_startup_policy(self, startup_policy: PluginStartupPolicy) -> Self
pub fn with_operation_router(self, router: ToolRouter) -> Self
pub fn extend_operation_router(self, router: ToolRouter) -> Self
pub fn with_prompt_router(self, router: PromptRouter) -> Self
pub fn with_resource_router(self, router: ResourceRouter) -> Self
pub fn with_completion_router(self, router: CompletionRouter) -> Self
pub fn with_task_router(self, router: TaskRouter) -> Self
pub fn on_initialize<F>(self, handler: F) -> Selfwhere
F: for<'a, 'ctx> Fn(PluginInitializeRequest, &'a mut PluginContext<'ctx>) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'a>> + Send + Sync + 'static,
pub fn on_initialized<F>(self, handler: F) -> Self
pub fn with_health<F>(self, handler: F) -> Self
pub fn with_subscribe_resource<F>(self, handler: F) -> Selfwhere
F: for<'a, 'ctx> Fn(SubscribeRequestParams, &'a mut PluginContext<'ctx>) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'a>> + Send + Sync + 'static,
pub fn with_unsubscribe_resource<F>(self, handler: F) -> Selfwhere
F: for<'a, 'ctx> Fn(UnsubscribeRequestParams, &'a mut PluginContext<'ctx>) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'a>> + Send + Sync + 'static,
pub fn with_set_log_level<F>(self, handler: F) -> Selfwhere
F: for<'a, 'ctx> Fn(SetLevelRequestParams, &'a mut PluginContext<'ctx>) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'a>> + Send + Sync + 'static,
pub fn on_channel_message<F>(self, handler: F) -> Self
pub fn on_bulk_transfer_message<F>(self, handler: F) -> Self
pub fn on_mesh_event<F>(self, handler: F) -> Self
pub fn on_open_stream<F>(self, handler: F) -> Selfwhere
F: for<'a, 'ctx> Fn(OpenStreamRequest, &'a mut PluginContext<'ctx>) -> Pin<Box<dyn Future<Output = PluginResult<Option<OpenStreamResponse>>> + Send + 'a>> + Send + Sync + 'static,
pub fn on_cancel_stream<F>(self, handler: F) -> Self
pub fn on_close_stream<F>(self, handler: F) -> Self
pub fn on_stream_error<F>(self, handler: F) -> Self
Trait Implementations§
Source§impl Clone for SimplePlugin
impl Clone for SimplePlugin
Source§fn clone(&self) -> SimplePlugin
fn clone(&self) -> SimplePlugin
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Plugin for SimplePlugin
impl Plugin for SimplePlugin
fn plugin_id(&self) -> &str
fn plugin_version(&self) -> String
fn server_info(&self) -> ServerInfo
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 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 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_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,
Auto Trait Implementations§
impl !RefUnwindSafe for SimplePlugin
impl !UnwindSafe for SimplePlugin
impl Freeze for SimplePlugin
impl Send for SimplePlugin
impl Sync for SimplePlugin
impl Unpin for SimplePlugin
impl UnsafeUnpin for SimplePlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more