Struct HyperRuntime

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

Implementations§

Source§

impl HyperRuntime

Source

pub async fn create(server: HyperServer) -> SdkResult<Self>

Source

pub fn graceful_shutdown(&self, timeout: Option<Duration>)

Source

pub async fn await_server(self) -> SdkResult<()>

Source

pub async fn runtime_by_session( &self, session_id: &SessionId, ) -> TransportServerResult<Arc<Mutex<Arc<ServerRuntime>>>>

Source

pub async fn send_request( &self, session_id: &SessionId, request: RequestFromServer, timeout: Option<Duration>, ) -> SdkResult<ResultFromClient>

Source

pub async fn send_notification( &self, session_id: &SessionId, notification: NotificationFromServer, ) -> SdkResult<()>

Source

pub async fn list_roots( &self, session_id: &SessionId, params: Option<ListRootsRequestParams>, ) -> SdkResult<ListRootsResult>

Request a list of root URIs from the client. Roots allow servers to ask for specific directories or files to operate on. A common example for roots is providing a set of repositories or directories a server should operate on. This request is typically used when the server needs to understand the file system structure or access specific locations that the client has permission to read from

Source

pub async fn send_logging_message( &self, session_id: &SessionId, params: LoggingMessageNotificationParams, ) -> SdkResult<()>

Source

pub async fn send_prompt_list_changed( &self, session_id: &SessionId, params: Option<PromptListChangedNotificationParams>, ) -> SdkResult<()>

An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.

Source

pub async fn send_resource_list_changed( &self, session_id: &SessionId, params: Option<ResourceListChangedNotificationParams>, ) -> SdkResult<()>

An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.

Source

pub async fn send_resource_updated( &self, session_id: &SessionId, params: ResourceUpdatedNotificationParams, ) -> SdkResult<()>

A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.

Source

pub async fn send_tool_list_changed( &self, session_id: &SessionId, params: Option<ToolListChangedNotificationParams>, ) -> SdkResult<()>

An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.

Source

pub async fn ping( &self, session_id: &SessionId, timeout: Option<Duration>, ) -> SdkResult<Result>

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

This function creates a PingRequest with no specific parameters, sends the request and awaits the response Once the response is received, it attempts to convert it into the expected result type.

§Returns

A SdkResult containing the rust_mcp_schema::Result if the request is successful. If the request or conversion fails, an error is returned.

Source

pub async fn create_message( &self, session_id: &SessionId, params: CreateMessageRequestParams, ) -> SdkResult<CreateMessageResult>

A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.

Source

pub async fn client_info( &self, session_id: &SessionId, ) -> SdkResult<Option<InitializeRequestParams>>

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,