pub type HttpsConnector = HttpsConnector<HttpConnector>;
Aliased Type§
struct HttpsConnector { /* private fields */ }
Implementations
Source§impl HttpsConnector<HttpConnector>
impl HttpsConnector<HttpConnector>
Sourcepub fn new() -> HttpsConnector<HttpConnector>
pub fn new() -> HttpsConnector<HttpConnector>
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 provded 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) -> HttpsConnector<T>
pub fn new_with_connector(http: T) -> HttpsConnector<T>
With connector constructor
Trait Implementations
Source§impl<T> Clone for HttpsConnector<T>where
T: Clone,
impl<T> Clone for HttpsConnector<T>where
T: Clone,
Source§fn clone(&self) -> HttpsConnector<T>
fn clone(&self) -> HttpsConnector<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Debug for HttpsConnector<T>where
T: Debug,
impl<T> Debug for HttpsConnector<T>where
T: Debug,
Source§impl<T> Default for HttpsConnector<T>where
T: Default,
impl<T> Default for HttpsConnector<T>where
T: Default,
Source§fn default() -> HttpsConnector<T>
fn default() -> HttpsConnector<T>
Returns the “default value” for a type. Read more
Source§impl<T> From<(T, TlsConnector)> for HttpsConnector<T>
impl<T> From<(T, TlsConnector)> for HttpsConnector<T>
Source§fn from(args: (T, TlsConnector)) -> HttpsConnector<T>
fn from(args: (T, TlsConnector)) -> HttpsConnector<T>
Converts to this type from the input type.
Source§impl<T> Service<Uri> for HttpsConnector<T>
impl<T> Service<Uri> for HttpsConnector<T>
Source§type Response = MaybeHttpsStream<<T as Service<Uri>>::Response>
type Response = MaybeHttpsStream<<T as Service<Uri>>::Response>
Responses given by the service.