/// Connect.
///
/// Returned future is resolved when the TLS-negotiation completes,
/// and the stream is ready to send and receive.
///
/// This is like the function you want to use.
Connect.
Returned future is resolved when the TLS-negotiation completes,
and the stream is ready to send and receive.

This is like the function you want to use.
Connect . Returned future is resolved when the TLS - negotiation completes and the stream is ready to send and receive . This is like the function you want to use .
fn connect<'a, S>(
        &'a self,
        domain: &'a str,
        stream: S,
    ) -> BoxFuture<'a, anyhow::Result<TlsStream>>
    where
        S: AsyncSocket,
    {
        BoxFuture::new(async move {
            self.connect_with_socket(domain, stream)
                .await
                .map(TlsStream::new)
        })
    }
fn connect < ' a , S > ( & ' a self , domain : & ' a str , stream : S , ) -> BoxFuture < ' a , anyhow :: Result < TlsStream > > where S : AsyncSocket , { BoxFuture :: new ( async move { self . connect_with_socket ( domain , stream ) . await . map ( TlsStream :: new ) } ) }
Connect.
Connect .
&'a self
domain
&'a str
stream
S