Skip to main content

ConnectionFactory

Trait ConnectionFactory 

Source
pub trait ConnectionFactory<S>: Send + Sync
where S: Service<RoleClient> + Send + Sync + 'static,
{ // Required method fn create_connection<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RunningService<RoleClient, S>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

Factory trait for creating new MCP connections.

Implement this trait to provide reconnection capability to ConnectionRefresher.

Required Methods§

Source

fn create_connection<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RunningService<RoleClient, S>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new connection to the MCP server.

Implementors§