Trait ReconnectableTransport

Source
pub trait ReconnectableTransport: Transport {
    // Required methods
    fn reconnect<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_reconnect_config(&mut self, config: ReconnectConfig);
    fn connection_state(&self) -> ConnectionState;
}
Expand description

Trait for transports that support reconnection

Required Methods§

Source

fn reconnect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Attempt to reconnect the transport

§Returns

Result indicating success or an error

Source

fn set_reconnect_config(&mut self, config: ReconnectConfig)

Set the reconnection configuration

§Arguments
  • config - Reconnection configuration
Source

fn connection_state(&self) -> ConnectionState

Get the current connection state

Implementors§