/// Creates and returns a new `ApiClient` instance.
///
/// # Errors
///
/// * If the underlying Hyper client cannot be created
/// * If a suitable SSL context cannot be established
/// * If an HTTP proxy cannot be correctly setup
/// * If a `User-Agent` HTTP header string cannot be constructed
Creates and returns a new `ApiClient` instance.
Creates and returns a new ` ApiClient ` instance .
pub fn new<T>(endpoint: T,
                  product: &str,
                  version: &str,
                  fs_root_path: Option<&Path>)
                  -> Result<Self>
        where T: IntoUrl
    {
        let endpoint = endpoint.into_url().map_err(Error::UrlParseError)?;
        Ok(ApiClient { inner: new_hyper_client(&endpoint, fs_root_path)?,
                       proxy: proxy_unless_domain_exempted(Some(&endpoint))?,
                       target_scheme: endpoint.scheme().to_string(),
                       endpoint,
                       user_agent_header: user_agent(product, version)? })
    }
pub fn new < T > ( endpoint : T , product : & str , version : & str , fs_root_path : Option < & Path > ) -> Result < Self > where T : IntoUrl { let endpoint = endpoint . into_url ( ) . map_err ( Error :: UrlParseError ) ? ; Ok ( ApiClient { inner : new_hyper_client ( & endpoint , fs_root_path ) ? , proxy : proxy_unless_domain_exempted ( Some ( & endpoint ) ) ? , target_scheme : endpoint . scheme ( ) . to_string ( ) , endpoint , user_agent_header : user_agent ( product , version ) ? } ) }
Creates and returns a new `ApiClient` instance.
Creates and returns a new ` ApiClient ` instance .
endpoint
T
product
&str
version
&str
fs_root_path
Option<&Path>
errors
If the underlying Hyper client cannot be created
If a suitable SSL context cannot be established
If an HTTP proxy cannot be correctly setup
If a `User-Agent` HTTP header string cannot be constructed
If the underlying Hyper client cannot be created If a suitable SSL context cannot be established If an HTTP proxy cannot be correctly setup If a ` User - Agent ` HTTP header string cannot be constructed