pub trait ClientTransport: Send {
// Required methods
fn request<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn notify<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_connected(&self) -> bool;
fn close<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Trait for MCP client transports
Required Methods§
Sourcefn request<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a request and receive a response
Sourcefn notify<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn notify<'life0, 'life1, 'async_trait>(
&'life0 mut self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a notification (no response expected)
Sourcefn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if the transport is still connected