Struct ClientRuntime

Source
pub struct ClientRuntime { /* private fields */ }

Trait Implementations§

Source§

impl McpClient for ClientRuntime

Source§

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,

Source§

fn start<'async_trait>( self: Arc<Self>, ) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,

Source§

fn set_server_details(&self, server_details: InitializeResult) -> SdkResult<()>

Source§

fn client_info(&self) -> &InitializeRequestParams

Source§

fn server_info(&self) -> Option<InitializeResult>

Source§

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,

Source§

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

👎Deprecated since 0.2.0: Use client_info() instead.
Source§

fn get_server_info(&self) -> Option<InitializeResult>

👎Deprecated since 0.2.0: Use server_info() instead.
Source§

fn is_initialized(&self) -> bool

Checks whether the server has been initialized with client
Source§

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>

👎Deprecated since 0.2.0: Use server_version() instead.
Source§

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>

👎Deprecated since 0.2.0: Use server_capabilities() instead.
Source§

fn server_has_tools(&self) -> Option<bool>

Checks if the server has tools available. Read more
Source§

fn server_has_prompts(&self) -> Option<bool>

Checks if the server has prompts available. Read more
Source§

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>

Checks if the server has resources available. Read more
Source§

fn server_supports_logging(&self) -> Option<bool>

Checks if the server supports logging. Read more
Source§

fn get_instructions(&self) -> Option<String>

👎Deprecated since 0.2.0: Use instructions() instead.
Source§

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,

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,

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,

A ping request to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected. Read more
Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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<()>

Asserts that server capabilities support the requested method. Read more
Source§

fn assert_client_notification_capabilities( &self, notification_method: &String, ) -> Result<(), RpcError>

Source§

fn assert_client_request_capabilities( &self, request_method: &String, ) -> Result<(), RpcError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,