pub struct TlsListener<L, T> { /* private fields */ }Expand description
A listener paired with its configured TLS acceptor. Native scheduler listeners have accept and close conveniences. Other listener representations can use listener and acceptor to perform their own accept operation followed by the same TLS handshake contract.
Implementations§
Source§impl<L, T> TlsListener<L, T>
impl<L, T> TlsListener<L, T>
Sourcepub fn new(listener: L, acceptor: T) -> Self
pub fn new(listener: L, acceptor: T) -> Self
Pair an existing listener with a TLS acceptor; no handshake takes place yet.
Sourcepub fn listener(&self) -> &L
pub fn listener(&self) -> &L
Borrow the underlying listener, for example to inspect its local address.
Sourcepub fn acceptor(&self) -> &T
pub fn acceptor(&self) -> &T
Borrow the provider for handshaking connections from a custom listener representation.
Sourcepub fn into_parts(self) -> (L, T)
pub fn into_parts(self) -> (L, T)
Recover the owned listener and TLS provider.
Sourcepub async fn accept<S>(
&self,
scheduler: &S,
cancellation: &Cancellation,
) -> OperationResult<(T::Connection, SocketAddress)>
pub async fn accept<S>( &self, scheduler: &S, cancellation: &Cancellation, ) -> OperationResult<(T::Connection, SocketAddress)>
Accept one native scheduler connection and complete its TLS handshake. Handshake failure closes that accepted connection through the provider and leaves the listener available for subsequent accepts. The caller drives concurrency explicitly by polling separate accept/connection operations.