pub struct PromptsGetHandler { /* private fields */ }Expand description
Prompts get handler for prompts/get endpoint only
Implementations§
Source§impl PromptsGetHandler
impl PromptsGetHandler
pub fn new() -> Self
pub fn add_prompt<P: McpPrompt + 'static>(self, prompt: P) -> Self
pub fn add_prompt_arc(self, prompt: Arc<dyn McpPrompt>) -> Self
Trait Implementations§
Source§impl Default for PromptsGetHandler
impl Default for PromptsGetHandler
Source§impl McpHandler for PromptsGetHandler
impl McpHandler for PromptsGetHandler
Source§fn handle<'life0, 'async_trait>(
&'life0 self,
params: Option<Value>,
) -> Pin<Box<dyn Future<Output = McpResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
params: Option<Value>,
) -> Pin<Box<dyn Future<Output = McpResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an MCP request
Source§fn supported_methods(&self) -> Vec<String>
fn supported_methods(&self) -> Vec<String>
Get the methods this handler supports
Source§fn handle_with_session<'life0, 'async_trait>(
&'life0 self,
params: Option<Value>,
_session: Option<SessionContext>,
) -> Pin<Box<dyn Future<Output = McpResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_with_session<'life0, 'async_trait>(
&'life0 self,
params: Option<Value>,
_session: Option<SessionContext>,
) -> Pin<Box<dyn Future<Output = McpResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an MCP request with session context (default implementation calls handle)
Auto Trait Implementations§
impl Freeze for PromptsGetHandler
impl !RefUnwindSafe for PromptsGetHandler
impl Send for PromptsGetHandler
impl Sync for PromptsGetHandler
impl Unpin for PromptsGetHandler
impl !UnwindSafe for PromptsGetHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.