pub fn build(&mut self) -> ::Result<Client> {
        if let Some(err) = self.err.take() {
            return Err(err);
        }
        let config = self.config
            .take()
            .expect("ClientBuilder cannot be reused after building a Client");

        let tls = try_!(config.tls.build());

        let proxies = Arc::new(config.proxies);

        let mut connector = Connector::new(config.dns_threads, tls, proxies.clone());
        if !config.hostname_verification {
            connector.danger_disable_hostname_verification();
        }

        let hyper_client = ::hyper::Client::builder()
            .build(connector);

        Ok(Client {
            inner: Arc::new(ClientRef {
                gzip: config.gzip,
                hyper: hyper_client,
                headers: config.headers,
                proxies: proxies,
                redirect_policy: config.redirect_policy,
                referer: config.referer,
            }),
        })
    }
/// Returns a `Client` that uses this `ClientBuilder` configuration.
///
/// # Errors
///
/// This method fails if native TLS backend cannot be initialized.
///
/// # Panics
///
/// This method consumes the internal state of the builder.
/// Trying to use this builder again after calling `build` will panic.
Returns a `Client` that uses this `ClientBuilder` configuration.
Returns a ` Client ` that uses this ` ClientBuilder ` configuration .
pub fn build(&mut self) -> ::Result<Client> {
        if let Some(err) = self.err.take() {
            return Err(err);
        }
        let config = self.config
            .take()
            .expect("ClientBuilder cannot be reused after building a Client");
        let tls = try_!(config.tls.build());
        let proxies = Arc::new(config.proxies);
        let mut connector = Connector::new(config.dns_threads, tls, proxies.clone());
        if !config.hostname_verification {
            connector.danger_disable_hostname_verification();
        }
        let hyper_client = ::hyper::Client::builder()
            .build(connector);
        Ok(Client {
            inner: Arc::new(ClientRef {
                gzip: config.gzip,
                hyper: hyper_client,
                headers: config.headers,
                proxies: proxies,
                redirect_policy: config.redirect_policy,
                referer: config.referer,
            }),
        })
    }
pub fn build ( & mut self ) -> :: Result < Client > { if let Some ( err ) = self . err . take ( ) { return Err ( err ) ; } let config = self . config . take ( ) . expect ( " " ) ; let tls = try_ ! ( config tls build ( ) ) ; let proxies = Arc :: new ( config . proxies ) ; let mut connector = Connector :: new ( config . dns_threads , tls , proxies . clone ( ) ) ; if ! config . hostname_verification { connector . danger_disable_hostname_verification ( ) ; } let hyper_client = :: hyper :: Client :: builder ( ) . build ( connector ) ; Ok ( Client { inner : Arc :: new ( ClientRef { gzip : config . gzip , hyper : hyper_client , headers : config . headers , proxies : proxies , redirect_policy : config . redirect_policy , referer : config . referer , } ) , } ) }
Returns a `Client` that uses this `ClientBuilder` configuration.
Returns a ` Client ` that uses this ` ClientBuilder ` configuration .
&mut self
&mut self
errors
This method fails if native TLS backend cannot be initialized.
This method fails if native TLS backend cannot be initialized .
panics
This method consumes the internal state of the builder.
Trying to use this builder again after calling `build` will panic.
This method consumes the internal state of the builder . Trying to use this builder again after calling ` build ` will panic .