pub struct HttpsConnector<T> { /* private fields */ }
http1
or http2
) and crate feature https
only.Expand description
A Connector for the https
scheme.
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 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) -> HttpsConnector<T>
pub fn new_with_connector(http: T) -> HttpsConnector<T>
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 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>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>
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>
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>
Auto Trait Implementations§
impl<T> Freeze for HttpsConnector<T>where
T: Freeze,
impl<T> RefUnwindSafe for HttpsConnector<T>where
T: RefUnwindSafe,
impl<T> Send for HttpsConnector<T>where
T: Send,
impl<T> Sync for HttpsConnector<T>where
T: Sync,
impl<T> Unpin for HttpsConnector<T>where
T: Unpin,
impl<T> UnwindSafe for HttpsConnector<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<S, R> ServiceExt<R> for Swhere
S: Service<R>,
impl<S, R> ServiceExt<R> for Swhere
S: Service<R>,
Source§fn into_make_service(self) -> IntoMakeService<S>
fn into_make_service(self) -> IntoMakeService<S>
MakeService
, that is a Service
whose
response is another service. Read moreSource§fn into_make_service_with_connect_info<C>(
self,
) -> IntoMakeServiceWithConnectInfo<S, C>
fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<S, C>
MakeService
, that will store C
’s
associated ConnectInfo
in a request extension such that ConnectInfo
can extract it. Read moreSource§fn handle_error<F, T>(self, f: F) -> HandleError<Self, F, T>
fn handle_error<F, T>(self, f: F) -> HandleError<Self, F, T>
HandleError
, that will handle errors
by converting them into responses. Read moreSource§impl<T, Request> ServiceExt<Request> for T
impl<T, Request> ServiceExt<Request> for T
Source§fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
fn ready(&mut self) -> Ready<'_, Self, Request>where
Self: Sized,
Source§fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
fn ready_oneshot(self) -> ReadyOneshot<Self, Request>where
Self: Sized,
Source§fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
fn oneshot(self, req: Request) -> Oneshot<Self, Request>where
Self: Sized,
Service
, calling it with the provided request once it is ready.Source§fn and_then<F>(self, f: F) -> AndThen<Self, F>
fn and_then<F>(self, f: F) -> AndThen<Self, F>
poll_ready
method. Read moreSource§fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
poll_ready
method. Read moreSource§fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
poll_ready
method. Read moreSource§fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
Result<Self::Response, Self::Error>
)
to a different value, regardless of whether the future succeeds or
fails. Read more