pub fn with_user_agent(
        user_agent: &'static UserAgent,
        datasource: DataSource,
        reactor: &reactor::Handle,
    ) -> Result<Self, Error> {
        let https_connector = HttpsConnector::new(4, reactor)
            .map_err(|cause| Error::Communication(cause.to_string()))?;
        let mut timeout_connector = TimeoutConnector::new(https_connector, reactor);
        timeout_connector.set_connect_timeout(Some(*datasource.timeout()));
        let client = Client::configure()
            .connector(timeout_connector)
            .build(reactor);
        debug!("Creating new JSON/HTTP connector for {:?}", &datasource);
        Ok(JsonHttpConnector {
            user_agent,
            datasource: Arc::new(datasource),
            token: Arc::new(None),
            client: Arc::new(client),
        })
    }
/// Creates a new instance of the `JsonHttpConnector` that uses the given
/// user agent.
///
/// The `user_agent` is used to set the User-Agent header field of the HTTP
/// protocol on each request sent by this connector.
///
/// # Arguments
///
/// * `user_agent` : a `UserAgent` used to set the User-Agent header field
///   of the HTTP protocol
/// * `datasource` : a `DataSource` that holds the connection parameters
///   used to connect to the database server.
/// * `reactor` : a handle of a `reactor::Core` instance of the `tokio-core`
///   crate.
Creates a new instance of the `JsonHttpConnector` that uses the given
user agent.

The `user_agent` is used to set the User-Agent header field of the HTTP
protocol on each request sent by this connector.
Creates a new instance of the ` JsonHttpConnector ` that uses the given user agent . The ` user_agent ` is used to set the User - Agent header field of the HTTP protocol on each request sent by this connector .
pub fn with_user_agent(
        user_agent: &'static UserAgent,
        datasource: DataSource,
        reactor: &reactor::Handle,
    ) -> Result<Self, Error> {
        let https_connector = HttpsConnector::new(4, reactor)
            .map_err(|cause| Error::Communication(cause.to_string()))?;
        let mut timeout_connector = TimeoutConnector::new(https_connector, reactor);
        timeout_connector.set_connect_timeout(Some(*datasource.timeout()));
        let client = Client::configure()
            .connector(timeout_connector)
            .build(reactor);
        debug!("Creating new JSON/HTTP connector for {:?}", &datasource);
        Ok(JsonHttpConnector {
            user_agent,
            datasource: Arc::new(datasource),
            token: Arc::new(None),
            client: Arc::new(client),
        })
    }
pub fn with_user_agent ( user_agent : & ' static UserAgent , datasource : DataSource , reactor : & reactor :: Handle , ) -> Result < Self , Error > { let https_connector = HttpsConnector :: new ( 4 , reactor ) . map_err ( | cause | Error :: Communication ( cause . to_string ( ) ) ) ? ; let mut timeout_connector = TimeoutConnector :: new ( https_connector , reactor ) ; timeout_connector . set_connect_timeout ( Some ( * datasource . timeout ( ) ) ) ; let client = Client :: configure ( ) . connector ( timeout_connector ) . build ( reactor ) ; debug ! ( " " datasource ) ; Ok ( JsonHttpConnector { user_agent , datasource : Arc :: new ( datasource ) , token : Arc :: new ( None ) , client : Arc :: new ( client ) , } ) }
Creates a new instance of the `JsonHttpConnector` that uses the given
user agent.
Creates a new instance of the ` JsonHttpConnector ` that uses the given user agent .
user_agent
&'static UserAgent
datasource
DataSource
reactor
&reactor::Handle
user_agent
&'static UserAgent
datasource
DataSource
reactor
&reactor::Handle