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§
Sourcefn list_tasks<'a>(
&'a self,
ctx: &'a Context<'_>,
) -> Pin<Box<dyn Future<Output = Result<ListTasksResult, McpError>> + Send + 'a>>
fn list_tasks<'a>( &'a self, ctx: &'a Context<'_>, ) -> Pin<Box<dyn Future<Output = Result<ListTasksResult, McpError>> + Send + 'a>>
Sourcefn get_task<'a>(
&'a self,
id: &'a TaskId,
ctx: &'a Context<'_>,
) -> Pin<Box<dyn Future<Output = Result<Option<GetTaskResult>, 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>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".