Struct axum_server::tls::TlsServer[][src]

pub struct TlsServer { /* fields omitted */ }
This is supported on crate feature tls-rustls only.
Expand description

Configurable HTTP and HTTPS server, supporting HTTP/1.1 and HTTP2.

See module page for examples.

Implementations

Create a new TlsServer.

Bind to a single address or multiple addresses.

Provide a Handle.

Successive calls will overwrite last Handle.

Bind to a single address or multiple addresses. Using tls protocol on streams.

Certificate and private key must be set before or after calling this.

Provide a loaded TlsLoader.

This will overwrite any previously set private key and certificate(s) with its own ones.

Provide ServerConfig containing private key and certificate(s).

When this value is set, other tls configurations are ignored.

Successive calls will overwrite last value.

Set private key in PEM format.

Successive calls will overwrite last private key.

Set certificate(s) in PEM format.

Successive calls will overwrite last certificate.

Set private key from file in PEM format.

Successive calls will overwrite last private key.

Set certificate(s) from file in PEM format.

Successive calls will overwrite last certificate.

Serve provided cloneable service on all binded addresses.

If accepting connection fails in any one of binded addresses, listening in all binded addresses will be stopped and then an error will be returned.

This is supported on crate feature record only.

Serve provided cloneable service on all binded addresses.

Record sent and received bytes for each connection independently. Sent and received bytes through a connection can be accessed through Request extensions.

See axum_server::record module for examples.

If accepting connection fails in any one of binded addresses, listening in all binded addresses will be stopped and then an error will be returned.

Trait Implementations

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

Performs the conversion.

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.