pub trait ConnectionFactory<S>: Send + Sync{
// 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§
Sourcefn 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,
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.