pub trait ClientHandler:
Sized
+ Send
+ Sync
+ 'static {
// Provided methods
fn ping(
&self,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<(), McpError>> + Send + '_ { ... }
fn create_message(
&self,
params: CreateMessageRequestParam,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<CreateMessageResult, McpError>> + Send + '_ { ... }
fn list_roots(
&self,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<ListRootsResult, McpError>> + Send + '_ { ... }
fn on_cancelled(
&self,
params: CancelledNotificationParam,
context: NotificationContext<RoleClient>,
) -> impl Future<Output = ()> + Send + '_ { ... }
fn on_progress(
&self,
params: ProgressNotificationParam,
context: NotificationContext<RoleClient>,
) -> impl Future<Output = ()> + Send + '_ { ... }
fn on_logging_message(
&self,
params: LoggingMessageNotificationParam,
context: NotificationContext<RoleClient>,
) -> impl Future<Output = ()> + Send + '_ { ... }
fn on_resource_updated(
&self,
params: ResourceUpdatedNotificationParam,
context: NotificationContext<RoleClient>,
) -> impl Future<Output = ()> + Send + '_ { ... }
fn on_resource_list_changed(
&self,
context: NotificationContext<RoleClient>,
) -> impl Future<Output = ()> + Send + '_ { ... }
fn on_tool_list_changed(
&self,
context: NotificationContext<RoleClient>,
) -> impl Future<Output = ()> + Send + '_ { ... }
fn on_prompt_list_changed(
&self,
context: NotificationContext<RoleClient>,
) -> impl Future<Output = ()> + Send + '_ { ... }
fn get_info(&self) -> ClientInfo { ... }
}Available on crate feature
client only.Provided Methods§
fn ping( &self, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<(), McpError>> + Send + '_
fn create_message( &self, params: CreateMessageRequestParam, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<CreateMessageResult, McpError>> + Send + '_
fn list_roots( &self, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<ListRootsResult, McpError>> + Send + '_
fn on_cancelled( &self, params: CancelledNotificationParam, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + Send + '_
fn on_progress( &self, params: ProgressNotificationParam, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + Send + '_
fn on_logging_message( &self, params: LoggingMessageNotificationParam, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + Send + '_
fn on_resource_updated( &self, params: ResourceUpdatedNotificationParam, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + Send + '_
fn on_resource_list_changed( &self, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + Send + '_
fn on_tool_list_changed( &self, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + Send + '_
fn on_prompt_list_changed( &self, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + Send + '_
fn get_info(&self) -> ClientInfo
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
impl ClientHandler for ()
Do nothing, with default client info.
Implementors§
impl ClientHandler for ClientInfo
Do nothing, with a specific client info.