pub struct TlsAcceptor {
inner: Arc<ServerConfig>,
}Expand description
A wrapper around a rustls::ServerConfig, providing an async accept method.
Fields§
§inner: Arc<ServerConfig>Implementations§
Source§impl TlsAcceptor
impl TlsAcceptor
Sourcepub fn accept<IO>(&self, stream: IO) -> Accept<IO> ⓘ
pub fn accept<IO>(&self, stream: IO) -> Accept<IO> ⓘ
Returns a future for completing a TLS handshake for a client using stream.
You likely want to wrap this in a timeout (for example with tokio::time::timeout)
to bound the handshake time.
Sourcepub fn accept_with<IO, F>(&self, stream: IO, f: F) -> Accept<IO> ⓘ
pub fn accept_with<IO, F>(&self, stream: IO, f: F) -> Accept<IO> ⓘ
Similar to Self::accept(), but calls f before performing the handshake.
As with Self::accept() 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, for example, adjusting the buffer limit.
Because no data has been read from stream yet when f is called ClientHello
dependent state (like early data) is not yet available.
Sourcepub fn config(&self) -> &Arc<ServerConfig>
pub fn config(&self) -> &Arc<ServerConfig>
Get a read-only reference to underlying config
Trait Implementations§
Source§impl Clone for TlsAcceptor
impl Clone for TlsAcceptor
Source§fn clone(&self) -> TlsAcceptor
fn clone(&self) -> TlsAcceptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more