pub struct HttpsConnector<T> { /* private fields */ }
Expand description
A Connector for the https
scheme.
Implementations§
Source§impl HttpsConnector<HttpConnector>
impl HttpsConnector<HttpConnector>
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new HttpsConnector
.
This uses hyper’s default HttpConnector
, and default TlsConnector
.
If you wish to use something besides the defaults, use From::from
.
§Note
By default this connector will use plain HTTP if the URL provided uses the HTTP scheme (eg: http://example.com/).
If you would like to force the use of HTTPS then call https_only(true)
on the returned connector.
§Panics
This will panic if the underlying TLS context could not be created.
To handle that error yourself, you can use the HttpsConnector::from
constructor after trying to make a TlsConnector
.
Source§impl<T> HttpsConnector<T>
impl<T> HttpsConnector<T>
Sourcepub fn https_only(&mut self, enable: bool)
pub fn https_only(&mut self, enable: bool)
Force the use of HTTPS when connecting.
If a URL is not https
when connecting, an error is returned.
Sourcepub fn new_with_connector(http: T) -> Self
pub fn new_with_connector(http: T) -> Self
With connector constructor
§Panics
This will panic if the underlying TLS context could not be created.
To handle that error yourself, you can use the HttpsConnector::from
constructor after trying to make a TlsConnector
.
Trait Implementations§
Source§impl<T: Clone> Clone for HttpsConnector<T>
impl<T: Clone> Clone for HttpsConnector<T>
Source§fn clone(&self) -> HttpsConnector<T>
fn clone(&self) -> HttpsConnector<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more