pub struct EndpointPoolTransport { /* private fields */ }Expand description
A round-robin endpoint pool with per-endpoint circuit state.
Read-only MCP methods may fail over to another endpoint. Mutating methods,
including tools/call, are attempted once unless the request contains
params._meta.idempotencyKey.
Implementations§
Source§impl EndpointPoolTransport
impl EndpointPoolTransport
pub fn new(config: EndpointPoolConfig) -> Self
pub fn add_endpoint( self, name: impl Into<String>, transport: impl Transport + 'static, ) -> Self
pub fn endpoint_count(&self) -> usize
Trait Implementations§
Source§impl Transport for EndpointPoolTransport
impl Transport for EndpointPoolTransport
Source§fn send_request<'life0, 'async_trait>(
&'life0 mut self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_request<'life0, 'async_trait>(
&'life0 mut self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a JSON-RPC request and wait for a response Read more
Source§fn send_notification<'life0, 'async_trait>(
&'life0 mut self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_notification<'life0, 'async_trait>(
&'life0 mut self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a JSON-RPC notification (no response expected) Read more
Source§fn receive_notification<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<Option<JsonRpcNotification>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_notification<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<Option<JsonRpcNotification>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive a notification from the server (non-blocking) Read more
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the transport connection Read more
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if the transport is connected Read more
Source§fn connection_info(&self) -> String
fn connection_info(&self) -> String
Get connection information for debugging Read more
Source§fn open_subscription<'life0, 'async_trait>(
&'life0 mut self,
_request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<ClientSubscription>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_subscription<'life0, 'async_trait>(
&'life0 mut self,
_request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<ClientSubscription>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open a modern long-lived subscription stream.
Source§fn cancel_subscription<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_request_id: &'life1 Value,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cancel_subscription<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_request_id: &'life1 Value,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Cancel an open subscription. HTTP implementations close the response
stream; STDIO implementations send
notifications/cancelled.Auto Trait Implementations§
impl !RefUnwindSafe for EndpointPoolTransport
impl !UnwindSafe for EndpointPoolTransport
impl Freeze for EndpointPoolTransport
impl Send for EndpointPoolTransport
impl Sync for EndpointPoolTransport
impl Unpin for EndpointPoolTransport
impl UnsafeUnpin for EndpointPoolTransport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].