#[non_exhaustive]pub struct StartHandshake<IO> {
pub accepted: Accepted,
pub io: IO,
}Expand description
An incoming connection received through LazyConfigAcceptor.
This contains the generic IO asynchronous transport,
ClientHello data,
and all the state required to continue the TLS handshake (e.g. via
StartHandshake::into_stream).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.accepted: Accepted§io: IOImplementations§
Source§impl<IO> StartHandshake<IO>
impl<IO> StartHandshake<IO>
Sourcepub fn from_parts(accepted: Accepted, transport: IO) -> Self
pub fn from_parts(accepted: Accepted, transport: IO) -> Self
Create a new object from an IO transport and prior TLS metadata.
pub fn client_hello(&self) -> ClientHello<'_>
Sourcepub fn into_stream(self, config: Arc<ServerConfig>) -> Accept<IO> ⓘ
pub fn into_stream(self, config: Arc<ServerConfig>) -> Accept<IO> ⓘ
Returns a future that performs the rest of the TLS handshake using config.
You likely want to wrap this in a timeout to bound the handshake time. Ideally
with tokio::time::timeout_at, reusing the deadline that also bounded
awaiting the LazyConfigAcceptor so both halves of the handshake share
one budget. See LazyConfigAcceptor::new().
Sourcepub fn into_stream_with<F>(self, config: Arc<ServerConfig>, f: F) -> Accept<IO> ⓘwhere
F: FnOnce(&mut ServerConnection),
pub fn into_stream_with<F>(self, config: Arc<ServerConfig>, f: F) -> Accept<IO> ⓘwhere
F: FnOnce(&mut ServerConnection),
Similar to Self::into_stream(), but calls f before performing the handshake.
As with Self::into_stream() you likely want to wrap this in a timeout to
bound the handshake time.
The f handler is given a mutable reference to a ServerConnection that can be
used to configure the connection before the handshake.