pub trait Accept<I, S> {
type Stream;
type Service;
type Future: Future<Output = Result<(Self::Stream, Self::Service)>>;
// Required method
fn accept(&self, stream: I, service: S) -> Self::Future;
}
Expand description
An asynchronous trait for processing and modifying IO streams and services.
Implementations of this trait can be used to modify or transform the input stream and service before further processing. For instance, this trait could be used to perform initial authentication, logging, or other setup operations on new connections.
Required Associated Types§
Required Methods§
Implementors§
Source§impl<A, I, S> Accept<I, S> for ProxyProtocolAcceptor<A>where
A: Accept<I, S> + Clone,
A::Stream: AsyncRead + AsyncWrite + Unpin,
I: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on crate feature proxy_protocol
only.
impl<A, I, S> Accept<I, S> for ProxyProtocolAcceptor<A>where
A: Accept<I, S> + Clone,
A::Stream: AsyncRead + AsyncWrite + Unpin,
I: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on crate feature
proxy_protocol
only.Source§impl<A, I, S> Accept<I, S> for OpenSSLAcceptor<A>
Available on crate feature tls-openssl
only.
impl<A, I, S> Accept<I, S> for OpenSSLAcceptor<A>
Available on crate feature
tls-openssl
only.Source§impl<A, I, S> Accept<I, S> for RustlsAcceptor<A>
Available on crate feature tls-rustls
only.
impl<A, I, S> Accept<I, S> for RustlsAcceptor<A>
Available on crate feature
tls-rustls
only.