pub struct ClientRuntime { /* private fields */ }
Trait Implementations§
Source§impl McpClient for ClientRuntime
impl McpClient for ClientRuntime
fn sender<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = &RwLock<Option<MessageDispatcher<ServerMessage>>>> + Send + 'async_trait>>where
MessageDispatcher<ServerMessage>: McpDispatch<ServerMessage, MessageFromClient>,
Self: 'async_trait,
'life0: 'async_trait,
fn start<'async_trait>(
self: Arc<Self>,
) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn set_server_details(&self, server_details: InitializeResult) -> SdkResult<()>
fn client_info(&self) -> &InitializeRequestParams
fn server_info(&self) -> Option<InitializeResult>
fn is_shut_down<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shut_down<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_client_info(&self) -> &InitializeRequestParams
fn get_client_info(&self) -> &InitializeRequestParams
👎Deprecated since 0.2.0: Use
client_info()
instead.Source§fn get_server_info(&self) -> Option<InitializeResult>
fn get_server_info(&self) -> Option<InitializeResult>
👎Deprecated since 0.2.0: Use
server_info()
instead.Source§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Checks whether the server has been initialized with client
Source§fn server_version(&self) -> Option<Implementation>
fn server_version(&self) -> Option<Implementation>
Returns the server’s name and version information once initialization is complete.
This method retrieves the server details, if available, after successful initialization.
Source§fn get_server_version(&self) -> Option<Implementation>
fn get_server_version(&self) -> Option<Implementation>
👎Deprecated since 0.2.0: Use
server_version()
instead.Source§fn server_capabilities(&self) -> Option<ServerCapabilities>
fn server_capabilities(&self) -> Option<ServerCapabilities>
Returns the server’s capabilities.
After initialization has completed, this will be populated with the server’s reported capabilities.
Source§fn get_server_capabilities(&self) -> Option<ServerCapabilities>
fn get_server_capabilities(&self) -> Option<ServerCapabilities>
👎Deprecated since 0.2.0: Use
server_capabilities()
instead.Source§fn server_has_tools(&self) -> Option<bool>
fn server_has_tools(&self) -> Option<bool>
Checks if the server has tools available. Read more
Source§fn server_has_prompts(&self) -> Option<bool>
fn server_has_prompts(&self) -> Option<bool>
Checks if the server has prompts available. Read more
Source§fn server_has_experimental(&self) -> Option<bool>
fn server_has_experimental(&self) -> Option<bool>
Checks if the server has experimental capabilities available. Read more
Source§fn server_has_resources(&self) -> Option<bool>
fn server_has_resources(&self) -> Option<bool>
Checks if the server has resources available. Read more
Source§fn server_supports_logging(&self) -> Option<bool>
fn server_supports_logging(&self) -> Option<bool>
Checks if the server supports logging. Read more
Source§fn get_instructions(&self) -> Option<String>
fn get_instructions(&self) -> Option<String>
👎Deprecated since 0.2.0: Use
instructions()
instead.fn instructions(&self) -> Option<String>
Source§fn request<'life0, 'async_trait>(
&'life0 self,
request: RequestFromClient,
timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = SdkResult<ResultFromServer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn request<'life0, 'async_trait>(
&'life0 self,
request: RequestFromClient,
timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = SdkResult<ResultFromServer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a request to the server and processes the response. Read more
Source§fn send_notification<'life0, 'async_trait>(
&'life0 self,
notification: NotificationFromClient,
) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_notification<'life0, 'async_trait>(
&'life0 self,
notification: NotificationFromClient,
) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a notification. This is a one-way message that is not expected
to return any response. The method asynchronously sends the notification using
the transport layer and does not wait for any acknowledgement or result.
Source§fn ping<'life0, 'async_trait>(
&'life0 self,
timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = SdkResult<Result>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ping<'life0, 'async_trait>(
&'life0 self,
timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = SdkResult<Result>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
A ping request to check that the other party is still alive.
The receiver must promptly respond, or else may be disconnected. Read more
fn complete<'life0, 'async_trait>(
&'life0 self,
params: CompleteRequestParams,
) -> Pin<Box<dyn Future<Output = SdkResult<CompleteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logging_level<'life0, 'async_trait>(
&'life0 self,
level: LoggingLevel,
) -> Pin<Box<dyn Future<Output = SdkResult<Result>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_prompt<'life0, 'async_trait>(
&'life0 self,
params: GetPromptRequestParams,
) -> Pin<Box<dyn Future<Output = SdkResult<GetPromptResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_prompts<'life0, 'async_trait>(
&'life0 self,
params: Option<ListPromptsRequestParams>,
) -> Pin<Box<dyn Future<Output = SdkResult<ListPromptsResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_resources<'life0, 'async_trait>(
&'life0 self,
params: Option<ListResourcesRequestParams>,
) -> Pin<Box<dyn Future<Output = SdkResult<ListResourcesResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_resource_templates<'life0, 'async_trait>(
&'life0 self,
params: Option<ListResourceTemplatesRequestParams>,
) -> Pin<Box<dyn Future<Output = SdkResult<ListResourceTemplatesResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_resource<'life0, 'async_trait>(
&'life0 self,
params: ReadResourceRequestParams,
) -> Pin<Box<dyn Future<Output = SdkResult<ReadResourceResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_resource<'life0, 'async_trait>(
&'life0 self,
params: SubscribeRequestParams,
) -> Pin<Box<dyn Future<Output = SdkResult<Result>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe_resource<'life0, 'async_trait>(
&'life0 self,
params: UnsubscribeRequestParams,
) -> Pin<Box<dyn Future<Output = SdkResult<Result>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call_tool<'life0, 'async_trait>(
&'life0 self,
params: CallToolRequestParams,
) -> Pin<Box<dyn Future<Output = SdkResult<CallToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_tools<'life0, 'async_trait>(
&'life0 self,
params: Option<ListToolsRequestParams>,
) -> Pin<Box<dyn Future<Output = SdkResult<ListToolsResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_roots_list_changed<'life0, 'async_trait>(
&'life0 self,
params: Option<RootsListChangedNotificationParams>,
) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn assert_server_capabilities(&self, request_method: &String) -> SdkResult<()>
fn assert_server_capabilities(&self, request_method: &String) -> SdkResult<()>
Asserts that server capabilities support the requested method. Read more
fn assert_client_notification_capabilities( &self, notification_method: &String, ) -> Result<(), RpcError>
fn assert_client_request_capabilities( &self, request_method: &String, ) -> Result<(), RpcError>
Auto Trait Implementations§
impl !Freeze for ClientRuntime
impl !RefUnwindSafe for ClientRuntime
impl Send for ClientRuntime
impl Sync for ClientRuntime
impl Unpin for ClientRuntime
impl !UnwindSafe for ClientRuntime
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