Skip to main content

DynTaskHandler

Trait DynTaskHandler 

Source
pub trait DynTaskHandler: Send + Sync {
    // Required methods
    fn list_tasks<'a>(
        &'a self,
        ctx: &'a Context<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<ListTasksResult, McpError>> + Send + 'a>>;
    fn get_task<'a>(
        &'a self,
        id: &'a TaskId,
        ctx: &'a Context<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<GetTaskResult>, McpError>> + Send + 'a>>;
    fn cancel_task<'a>(
        &'a self,
        id: &'a TaskId,
        ctx: &'a Context<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CancelTaskResult>, McpError>> + Send + 'a>>;
}
Expand description

Object-safe form of TaskHandler.

Required Methods§

Source

fn list_tasks<'a>( &'a self, ctx: &'a Context<'_>, ) -> Pin<Box<dyn Future<Output = Result<ListTasksResult, McpError>> + Send + 'a>>

Source

fn get_task<'a>( &'a self, id: &'a TaskId, ctx: &'a Context<'_>, ) -> Pin<Box<dyn Future<Output = Result<Option<GetTaskResult>, McpError>> + Send + 'a>>

Source

fn cancel_task<'a>( &'a self, id: &'a TaskId, ctx: &'a Context<'_>, ) -> Pin<Box<dyn Future<Output = Result<Option<CancelTaskResult>, McpError>> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§