Trait tide_rustls::CustomTlsAcceptor[][src]

pub trait CustomTlsAcceptor: Send + Sync {
#[must_use]    fn accept<'life0, 'async_trait>(
        &'life0 self,
        stream: TcpStream
    ) -> Pin<Box<dyn Future<Output = Result<Option<TlsStream<TcpStream>>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

The CustomTlsAcceptor trait provides a custom implementation of accepting TLS connections from a TcpStream. tide-rustls will call the CustomTlsAcceptor::accept function for each new TcpStream it accepts, to obtain a TlsStream).

Implementing this trait gives you control over the TLS negotiation process, and allows you to process some TLS connections internally without passing them through to tide, such as for multiplexing or custom ALPN negotiation.

Required methods

#[must_use]fn accept<'life0, 'async_trait>(
    &'life0 self,
    stream: TcpStream
) -> Pin<Box<dyn Future<Output = Result<Option<TlsStream<TcpStream>>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Accept a TlsStream from a TcpStream.

If TLS negotiation succeeds, but does not result in a stream that tide should process HTTP connections from, return Ok(None).

Loading content...

Implementors

Loading content...