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 'life0: 'async_trait, Self: 'async_trait; }
Available on crate features mcp and tools only.
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 'life0: 'async_trait, Self: 'async_trait,

Create a new connection to the MCP server.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§