Skip to main content

DynPromptHandler

Trait DynPromptHandler 

Source
pub trait DynPromptHandler: Send + Sync {
    // Required methods
    fn list_prompts<'a>(
        &'a self,
        ctx: &'a Context<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Prompt>, McpError>> + Send + 'a>>;
    fn get_prompt<'a>(
        &'a self,
        name: &'a str,
        args: Option<Map<String, Value>>,
        ctx: &'a Context<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<GetPromptResult, McpError>> + Send + 'a>>;
}
Expand description

Object-safe form of PromptHandler (only the dispatched methods).

Required Methods§

Source

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

Source

fn get_prompt<'a>( &'a self, name: &'a str, args: Option<Map<String, Value>>, ctx: &'a Context<'_>, ) -> Pin<Box<dyn Future<Output = Result<GetPromptResult, McpError>> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§