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.

Shorthand for using rustls’ safe defaults and native roots

See ConfigBuilderExt::with_native_roots

This is supported on crate feature webpki-roots only.

Shorthand for using rustls’ safe defaults and Mozilla roots

See ConfigBuilderExt::with_webpki_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

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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