Struct hyper_rustls::HttpsConnectorBuilder [−][src]
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
Creates a new ConnectorBuilder
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.
This is supported on crate feature rustls-native-certs
only.
rustls-native-certs
only.Shorthand for using rustls’ safe defaults and native roots
This is supported on crate feature webpki-roots
only.
webpki-roots
only.Shorthand for using rustls’ safe defaults and Mozilla roots
Enforce the use of HTTPS when connecting
Only URLs using the HTTPS scheme will be connectable.
Allow both HTTPS and HTTP when connecting
HTTPS URLs will be handled through rustls, HTTP URLs will be handled by the lower-level connector.
Enable HTTP1
This needs to be called explicitly, no protocol is enabled by default
Enable HTTP2
This needs to be called explicitly, no protocol is enabled by default
Enable HTTP2
This needs to be called explicitly, no protocol is enabled by default
This builds an HttpsConnector
built on hyper’s default HttpConnector
This wraps an arbitrary low-level connector into an HttpsConnector
This builds an HttpsConnector
built on hyper’s default HttpConnector
This wraps an arbitrary low-level connector into an HttpsConnector
Trait Implementations
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
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more