pub struct ResourceTemplatesHandler { /* private fields */ }Expand description
Resource templates handler for resources/templates/list endpoint
Implementations§
Source§impl ResourceTemplatesHandler
impl ResourceTemplatesHandler
pub fn new() -> Self
pub fn with_templates( self, templates: Vec<(UriTemplate, Arc<dyn McpResource>)>, ) -> Self
Trait Implementations§
Source§impl Default for ResourceTemplatesHandler
impl Default for ResourceTemplatesHandler
Source§impl McpHandler for ResourceTemplatesHandler
impl McpHandler for ResourceTemplatesHandler
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 ResourceTemplatesHandler
impl !RefUnwindSafe for ResourceTemplatesHandler
impl Send for ResourceTemplatesHandler
impl Sync for ResourceTemplatesHandler
impl Unpin for ResourceTemplatesHandler
impl !UnwindSafe for ResourceTemplatesHandler
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.