pub struct DefaultMessageHandler {
pub server_info: Implementation,
pub capabilities: ServerCapabilities,
}Expand description
Default implementation of MessageHandler
Fields§
§server_info: ImplementationInformation about the server implementation
capabilities: ServerCapabilitiesCapabilities supported by the server
Implementations§
Source§impl DefaultMessageHandler
impl DefaultMessageHandler
Sourcepub fn new(
server_info: Implementation,
capabilities: ServerCapabilities,
) -> Self
pub fn new( server_info: Implementation, capabilities: ServerCapabilities, ) -> Self
Creates a new default message handler with the specified server info and capabilities
Trait Implementations§
Source§impl MessageHandler for DefaultMessageHandler
impl MessageHandler for DefaultMessageHandler
Source§fn handle_initialize<'life0, 'async_trait>(
&'life0 self,
request: InitializeRequest,
) -> Pin<Box<dyn Future<Output = Result<InitializeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_initialize<'life0, 'async_trait>(
&'life0 self,
request: InitializeRequest,
) -> Pin<Box<dyn Future<Output = Result<InitializeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an initialize request
Source§fn handle_initialized<'life0, 'async_trait>(
&'life0 self,
_notification: InitializedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_initialized<'life0, 'async_trait>(
&'life0 self,
_notification: InitializedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an initialized notification
Source§fn handle_ping<'life0, 'async_trait>(
&'life0 self,
request: PingRequest,
) -> Pin<Box<dyn Future<Output = Result<PingResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_ping<'life0, 'async_trait>(
&'life0 self,
request: PingRequest,
) -> Pin<Box<dyn Future<Output = Result<PingResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a ping request
Source§fn handle_resources_list<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesListRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_resources_list<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesListRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle resources/list request
Source§fn handle_resources_read<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesReadRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesReadResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_resources_read<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesReadRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesReadResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle resources/read request
Source§fn handle_resources_subscribe<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesSubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesSubscribeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_resources_subscribe<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesSubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesSubscribeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle resources/subscribe request
Source§fn handle_resources_unsubscribe<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesUnsubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesUnsubscribeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_resources_unsubscribe<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesUnsubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesUnsubscribeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle resources/unsubscribe request
Source§fn handle_tools_list<'life0, 'async_trait>(
&'life0 self,
_request: ToolsListRequest,
) -> Pin<Box<dyn Future<Output = Result<ToolsListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_tools_list<'life0, 'async_trait>(
&'life0 self,
_request: ToolsListRequest,
) -> Pin<Box<dyn Future<Output = Result<ToolsListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle tools/list request
Source§fn handle_tools_call<'life0, 'async_trait>(
&'life0 self,
_request: ToolsCallRequest,
) -> Pin<Box<dyn Future<Output = Result<ToolsCallResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_tools_call<'life0, 'async_trait>(
&'life0 self,
_request: ToolsCallRequest,
) -> Pin<Box<dyn Future<Output = Result<ToolsCallResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle tools/call request
Source§fn handle_prompts_list<'life0, 'async_trait>(
&'life0 self,
_request: PromptsListRequest,
) -> Pin<Box<dyn Future<Output = Result<PromptsListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_prompts_list<'life0, 'async_trait>(
&'life0 self,
_request: PromptsListRequest,
) -> Pin<Box<dyn Future<Output = Result<PromptsListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle prompts/list request
Source§fn handle_prompts_get<'life0, 'async_trait>(
&'life0 self,
_request: PromptsGetRequest,
) -> Pin<Box<dyn Future<Output = Result<PromptsGetResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_prompts_get<'life0, 'async_trait>(
&'life0 self,
_request: PromptsGetRequest,
) -> Pin<Box<dyn Future<Output = Result<PromptsGetResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle prompts/get request
Source§fn handle_logging_set_level<'life0, 'async_trait>(
&'life0 self,
_request: LoggingSetLevelRequest,
) -> Pin<Box<dyn Future<Output = Result<LoggingSetLevelResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_logging_set_level<'life0, 'async_trait>(
&'life0 self,
_request: LoggingSetLevelRequest,
) -> Pin<Box<dyn Future<Output = Result<LoggingSetLevelResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle logging/setLevel request
Source§fn handle_sampling_create_message<'life0, 'async_trait>(
&'life0 self,
_request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateMessageResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_sampling_create_message<'life0, 'async_trait>(
&'life0 self,
_request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateMessageResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle sampling/createMessage request (client capability)
Source§fn handle_roots_list<'life0, 'async_trait>(
&'life0 self,
_request: RootsListRequest,
) -> Pin<Box<dyn Future<Output = Result<RootsListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_roots_list<'life0, 'async_trait>(
&'life0 self,
_request: RootsListRequest,
) -> Pin<Box<dyn Future<Output = Result<RootsListResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle roots/list request (client capability)
Source§fn handle_progress_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ProgressNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_progress_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ProgressNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle progress notification
Source§fn handle_logging_notification<'life0, 'async_trait>(
&'life0 self,
_notification: LoggingNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_logging_notification<'life0, 'async_trait>(
&'life0 self,
_notification: LoggingNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle logging notification
Source§fn handle_cancelled_notification<'life0, 'async_trait>(
&'life0 self,
_notification: CancelledNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_cancelled_notification<'life0, 'async_trait>(
&'life0 self,
_notification: CancelledNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle cancelled notification
Source§fn handle_resources_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ResourcesUpdatedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_resources_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ResourcesUpdatedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle resources updated notification
Source§fn handle_tools_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ToolsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_tools_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ToolsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle tools updated notification
Source§fn handle_prompts_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: PromptsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_prompts_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: PromptsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle prompts updated notification
Source§fn handle_roots_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: RootsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_roots_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: RootsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle roots updated notification
Auto Trait Implementations§
impl Freeze for DefaultMessageHandler
impl RefUnwindSafe for DefaultMessageHandler
impl Send for DefaultMessageHandler
impl Sync for DefaultMessageHandler
impl Unpin for DefaultMessageHandler
impl UnsafeUnpin for DefaultMessageHandler
impl UnwindSafe for DefaultMessageHandler
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