pub struct TlsReloadHandle { /* private fields */ }Expand description
Atomic reload handle for TLS identity/trust state (Plan 203 Track F).
Immutable validated ServerConfig snapshots are swapped atomically;
new handshakes read the current snapshot while established connections
keep their session. Reload is all-or-nothing: build the replacement
TlsServerConfig first (which validates), then Self::replace;
a failed build never touches the live snapshot.
No filesystem watcher is provided; operators load PEM and call replace when they decide files changed.
Implementations§
Source§impl TlsReloadHandle
impl TlsReloadHandle
Sourcepub fn new(initial: Arc<ServerConfig>) -> Self
pub fn new(initial: Arc<ServerConfig>) -> Self
Create a handle around an initial validated configuration.
Sourcepub fn from_tls_server_config(config: &TlsServerConfig) -> Self
pub fn from_tls_server_config(config: &TlsServerConfig) -> Self
Create a handle from a validated TlsServerConfig.
Sourcepub fn current(&self) -> Arc<ServerConfig> ⓘ
pub fn current(&self) -> Arc<ServerConfig> ⓘ
Current snapshot for the next handshake (cheap Arc clone).
Sourcepub fn replace(&self, next: Arc<ServerConfig>)
pub fn replace(&self, next: Arc<ServerConfig>)
Atomically replace the snapshot for new handshakes.
Existing connections are unaffected. Never fails; the caller must
validate via TlsServerConfigBuilder::build before calling so a
failed build cannot corrupt live state.
Sourcepub fn replace_tls_server_config(&self, next: &TlsServerConfig)
pub fn replace_tls_server_config(&self, next: &TlsServerConfig)
Replace from a validated TlsServerConfig.