pub struct PromptManager { /* private fields */ }
Expand description
Manages prompts for the MCP server
Implementations§
Source§impl PromptManager
impl PromptManager
Sourcepub fn register_prompt(
&self,
prompt: Prompt,
handler: impl Fn(Option<HashMap<String, String>>) -> Result<Vec<PromptMessage>> + Send + Sync + 'static,
)
pub fn register_prompt( &self, prompt: Prompt, handler: impl Fn(Option<HashMap<String, String>>) -> Result<Vec<PromptMessage>> + Send + Sync + 'static, )
Register a prompt with the manager
Sourcepub fn register_completion_provider(
&self,
prompt_name: &str,
param_name: &str,
handler: impl Fn(String, Option<String>) -> Result<Vec<String>> + Send + Sync + 'static,
)
pub fn register_completion_provider( &self, prompt_name: &str, param_name: &str, handler: impl Fn(String, Option<String>) -> Result<Vec<String>> + Send + Sync + 'static, )
Register a completion provider for a prompt parameter
Sourcepub async fn get_completions(
&self,
prompt_name: &str,
param_name: &str,
value: Option<String>,
) -> Result<Vec<String>>
pub async fn get_completions( &self, prompt_name: &str, param_name: &str, value: Option<String>, ) -> Result<Vec<String>>
Get completions for a prompt parameter
Sourcepub async fn list_prompts(
&self,
cursor: Option<String>,
) -> (Vec<Prompt>, Option<String>)
pub async fn list_prompts( &self, cursor: Option<String>, ) -> (Vec<Prompt>, Option<String>)
List all registered prompts with optional pagination
Sourcepub async fn get_prompt(
&self,
name: &str,
arguments: Option<HashMap<String, String>>,
) -> Result<PromptGetResult>
pub async fn get_prompt( &self, name: &str, arguments: Option<HashMap<String, String>>, ) -> Result<PromptGetResult>
Get a prompt by name and generate its content with the provided arguments
Sourcepub fn subscribe_to_updates(&self) -> Receiver<()>
pub fn subscribe_to_updates(&self) -> Receiver<()>
Subscribe to prompt list updates
Auto Trait Implementations§
impl !Freeze for PromptManager
impl !RefUnwindSafe for PromptManager
impl Send for PromptManager
impl Sync for PromptManager
impl Unpin for PromptManager
impl !UnwindSafe for PromptManager
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