pub struct TlsSettings {
pub acceptor: TlsAcceptor,
pub handshake_timeout: Duration,
}Expand description
Everything one handshake needs, as a single swappable value.
The pair travels together because both halves come from the same [tls]
section and both are read at the same moment — the top of a handshake. Making
this the unit crate::listener’s accept loop reads is what lets a renewed
certificate and a changed handshake_timeout_ms land without rebinding the
socket: a configuration reload publishes a new TlsSettings and the next
connection uses it, while connections already established are untouched.
That cell is an Option, and the absence is tls.enabled = false — which is
why turning TLS on or off is not a different listener type either.
Fields§
§acceptor: TlsAcceptor§handshake_timeout: DurationImplementations§
Source§impl TlsSettings
impl TlsSettings
pub fn new(acceptor: TlsAcceptor, handshake_timeout: Duration) -> Self
Trait Implementations§
Source§impl Clone for TlsSettings
impl Clone for TlsSettings
Source§fn clone(&self) -> TlsSettings
fn clone(&self) -> TlsSettings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TlsSettings
impl !UnwindSafe for TlsSettings
impl Freeze for TlsSettings
impl Send for TlsSettings
impl Sync for TlsSettings
impl Unpin for TlsSettings
impl UnsafeUnpin for TlsSettings
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more