pub trait MakeConnection<Target>: Sealed<(Target,)> {
type Connection: AsyncRead + AsyncWrite;
type Error;
// Required method
fn make_connection(
&self,
target: Target,
) -> impl Future<Output = Result<Self::Connection, Self::Error>>;
}
Available on crate feature
make
only.Expand description
The MakeConnection
trait is used to create transports.
The goal of this service is to allow composable methods for creating
AsyncRead + AsyncWrite
transports. This could mean creating a TLS
based connection or using some other method to authenticate the connection.
Required Associated Types§
Sourcetype Connection: AsyncRead + AsyncWrite
type Connection: AsyncRead + AsyncWrite
The transport provided by this service
Required Methods§
Sourcefn make_connection(
&self,
target: Target,
) -> impl Future<Output = Result<Self::Connection, Self::Error>>
fn make_connection( &self, target: Target, ) -> impl Future<Output = Result<Self::Connection, Self::Error>>
Connect and return a transport asynchronously
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.