Crate rustls_config_stream

Crate rustls_config_stream 

Source
Expand description

§rustls-config-stream

Crates.io Version Tests codecov Crates.io License dependency status CodeFactor

rustls::ServerConfig and rustls::ClientConfig providers backed async streams.

This module exposes a ServerConfigProvider and ClientConfigProvider. Both function identically, holding the current config in an ArcSwap, providing a get_config() method to load the current config as a standard Arc, and storing a new config when it arrives from a user-supplied stream via a ServerConfigStreamBuilder or ClientConfigStreamBuilder.

The background task performs exponential backoff (10ms -> 10s, doubling) when the stream fails, and attempts to re-create the stream via the builder.

§Usage

§Tracing

If the tracing feature is enabled, the provider will emit diagnostics (debug/info/error) about updates and reconnection attempts.

Structs§

ClientConfigProvider
Holds the current ClientConfig and refreshes it from an async stream.
ServerConfigProvider
Holds the current ServerConfig and refreshes it from an async stream.

Enums§

ClientConfigStreamError
Errors that can occur while building or consuming a client-config stream.
ServerConfigStreamError
Errors that can occur while building or consuming a server-config stream.

Traits§

ClientConfigStreamBuilder
A factory for producing a stream of rustls::ClientConfig.
ServerConfigStreamBuilder
A factory for producing a stream of rustls::ServerConfig.