Struct hyper_rustls::HttpsConnectorBuilder
source · [−]pub struct HttpsConnectorBuilder<State>(_);
Expand description
A builder for an HttpsConnector
This makes configuration flexible and explicit and ensures connector features match crate features
Examples
use hyper_rustls::HttpsConnectorBuilder;
let https = HttpsConnectorBuilder::new()
.with_webpki_roots()
.https_only()
.enable_http1()
.build();
Implementations
sourceimpl ConnectorBuilder<WantsTlsConfig>
impl ConnectorBuilder<WantsTlsConfig>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ConnectorBuilder
sourcepub fn with_tls_config(
self,
config: ClientConfig
) -> ConnectorBuilder<WantsSchemes>
pub fn with_tls_config(
self,
config: ClientConfig
) -> ConnectorBuilder<WantsSchemes>
Passes a rustls ClientConfig
to configure the TLS connection
The alpn_protocols
field is
required to be empty (or the function will panic) and will be
rewritten to match the enabled schemes (see
enable_http1
,
enable_http2
) before the
connector is built.
sourceimpl ConnectorBuilder<WantsSchemes>
impl ConnectorBuilder<WantsSchemes>
sourcepub fn https_only(self) -> ConnectorBuilder<WantsProtocols1>
pub fn https_only(self) -> ConnectorBuilder<WantsProtocols1>
Enforce the use of HTTPS when connecting
Only URLs using the HTTPS scheme will be connectable.
sourcepub fn https_or_http(self) -> ConnectorBuilder<WantsProtocols1>
pub fn https_or_http(self) -> ConnectorBuilder<WantsProtocols1>
Allow both HTTPS and HTTP when connecting
HTTPS URLs will be handled through rustls, HTTP URLs will be handled by the lower-level connector.
sourceimpl ConnectorBuilder<WantsProtocols2>
impl ConnectorBuilder<WantsProtocols2>
sourcepub fn wrap_connector<H>(self, conn: H) -> HttpsConnector<H>
pub fn wrap_connector<H>(self, conn: H) -> HttpsConnector<H>
This wraps an arbitrary low-level connector into an HttpsConnector
Trait Implementations
sourceimpl Default for ConnectorBuilder<WantsTlsConfig>
impl Default for ConnectorBuilder<WantsTlsConfig>
Auto Trait Implementations
impl<State> RefUnwindSafe for ConnectorBuilder<State> where
State: RefUnwindSafe,
impl<State> Send for ConnectorBuilder<State> where
State: Send,
impl<State> Sync for ConnectorBuilder<State> where
State: Sync,
impl<State> Unpin for ConnectorBuilder<State> where
State: Unpin,
impl<State> UnwindSafe for ConnectorBuilder<State> where
State: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more