Trait hyper_server::accept::Accept
source · 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§
sourcefn accept(&self, stream: I, service: S) -> Self::Future
fn accept(&self, stream: I, service: S) -> Self::Future
Asynchronously process and possibly modify the given IO stream and service.
Parameters:
stream
: The incoming IO stream, typically a connection.service
: The associated service with the stream.
Returns:
A future resolving to the modified stream and service, or an error.
Implementors§
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.