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,
) -> DefaultMessageHandler
pub fn new( server_info: Implementation, capabilities: ServerCapabilities, ) -> DefaultMessageHandler
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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
DefaultMessageHandler: 'async_trait,
fn handle_initialize<'life0, 'async_trait>(
&'life0 self,
request: InitializeRequest,
) -> Pin<Box<dyn Future<Output = Result<InitializeResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
DefaultMessageHandler: 'async_trait,
Handle an initialize request
Source§fn handle_initialized<'life0, 'async_trait>(
&'life0 self,
_notification: InitializedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_initialized<'life0, 'async_trait>(
&'life0 self,
_notification: InitializedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle an initialized notification
Source§fn handle_ping<'life0, 'async_trait>(
&'life0 self,
request: PingRequest,
) -> Pin<Box<dyn Future<Output = Result<PingResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_ping<'life0, 'async_trait>(
&'life0 self,
request: PingRequest,
) -> Pin<Box<dyn Future<Output = Result<PingResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_resources_list<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesListRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesListResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_resources_read<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesReadRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesReadResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_resources_subscribe<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesSubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesSubscribeResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_resources_unsubscribe<'life0, 'async_trait>(
&'life0 self,
_request: ResourcesUnsubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<ResourcesUnsubscribeResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_tools_list<'life0, 'async_trait>(
&'life0 self,
_request: ToolsListRequest,
) -> Pin<Box<dyn Future<Output = Result<ToolsListResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_tools_call<'life0, 'async_trait>(
&'life0 self,
_request: ToolsCallRequest,
) -> Pin<Box<dyn Future<Output = Result<ToolsCallResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_prompts_list<'life0, 'async_trait>(
&'life0 self,
_request: PromptsListRequest,
) -> Pin<Box<dyn Future<Output = Result<PromptsListResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_prompts_get<'life0, 'async_trait>(
&'life0 self,
_request: PromptsGetRequest,
) -> Pin<Box<dyn Future<Output = Result<PromptsGetResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_logging_set_level<'life0, 'async_trait>(
&'life0 self,
_request: LoggingSetLevelRequest,
) -> Pin<Box<dyn Future<Output = Result<LoggingSetLevelResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_sampling_create_message<'life0, 'async_trait>(
&'life0 self,
_request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateMessageResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_roots_list<'life0, 'async_trait>(
&'life0 self,
_request: RootsListRequest,
) -> Pin<Box<dyn Future<Output = Result<RootsListResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_progress_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ProgressNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle progress notification
Source§fn handle_logging_notification<'life0, 'async_trait>(
&'life0 self,
_notification: LoggingNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_logging_notification<'life0, 'async_trait>(
&'life0 self,
_notification: LoggingNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle logging notification
Source§fn handle_cancelled_notification<'life0, 'async_trait>(
&'life0 self,
_notification: CancelledNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_cancelled_notification<'life0, 'async_trait>(
&'life0 self,
_notification: CancelledNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle cancelled notification
Source§fn handle_resources_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ResourcesUpdatedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_resources_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ResourcesUpdatedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_tools_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: ToolsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_prompts_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: PromptsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_roots_updated_notification<'life0, 'async_trait>(
&'life0 self,
_notification: RootsListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Handle roots updated notification
Source§fn handle_custom_request<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
_params: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn handle_custom_request<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
_params: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Handle custom/unknown requests
Source§fn handle_custom_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
_params: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn handle_custom_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
_params: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Handle custom/unknown notifications
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