/// Make a new ClientSession.  `config` controls how
/// we behave in the TLS protocol, `hostname` is the
/// hostname of who we want to talk to.
Make a new ClientSession.  `config` controls how
we behave in the TLS protocol, `hostname` is the
hostname of who we want to talk to.
Make a new ClientSession . ` config ` controls how we behave in the TLS protocol ` hostname ` is the hostname of who we want to talk to .
pub fn new(
        config: &Arc<ClientConfig>,
        hostname: webpki::DNSNameRef,
    ) -> Result<ClientSession, TlsError> {
        let mut new = Self::from_config(config);
        new.start_handshake(hostname.into(), vec![])?;
        Ok(new)
    }
pub fn new ( config : & Arc < ClientConfig > , hostname : webpki :: DNSNameRef , ) -> Result < ClientSession , TlsError > { let mut new = Self :: from_config ( config ) ; new . start_handshake ( hostname . into ( ) , vec ! [ ] ) ? ; Ok ( new ) }
Make a new ClientSession.
Make a new ClientSession .
config
&Arc<ClientConfig>
hostname
webpki::DNSNameRef