pub trait ConnectionFactory: Send + Sync {
type Connection: Send + Sync + 'static;
// Required methods
fn connect<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
host: &'life1 HostRecord,
cancellation: &'life2 CancellationToken,
) -> Pin<Box<dyn Future<Output = FleetResult<Self::Connection>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn close<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 Self::Connection,
) -> Pin<Box<dyn Future<Output = FleetResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Driver that opens and closes revision-bound host connections.
Required Associated Types§
Sourcetype Connection: Send + Sync + 'static
type Connection: Send + Sync + 'static
Concrete connection handle cached by consumers.
Required Methods§
Sourcefn connect<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
host: &'life1 HostRecord,
cancellation: &'life2 CancellationToken,
) -> Pin<Box<dyn Future<Output = FleetResult<Self::Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn connect<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
host: &'life1 HostRecord,
cancellation: &'life2 CancellationToken,
) -> Pin<Box<dyn Future<Output = FleetResult<Self::Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Opens a connection for the exact host revision.
Sourcefn close<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 Self::Connection,
) -> Pin<Box<dyn Future<Output = FleetResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn close<'life0, 'life1, 'async_trait>(
&'life0 self,
connection: &'life1 Self::Connection,
) -> Pin<Box<dyn Future<Output = FleetResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Closes a connection explicitly when invalidated or evicted.