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 function to modify io stream and service.

Required Associated Types§

source

type Stream

IO stream produced by accept.

source

type Service

Service produced by accept.

source

type Future: Future<Output = Result<(Self::Stream, Self::Service)>>

Future return value.

Required Methods§

source

fn accept(&self, stream: I, service: S) -> Self::Future

Process io stream and service asynchronously.

Implementors§

source§

impl<A, I, S> Accept<I, S> for OpenSSLAcceptor<A>
where A: Accept<I, S>, A::Stream: AsyncRead + AsyncWrite + Unpin,

Available on crate feature tls-openssl only.
§

type Stream = SslStream<<A as Accept<I, S>>::Stream>

§

type Service = <A as Accept<I, S>>::Service

§

type Future = OpenSSLAcceptorFuture<<A as Accept<I, S>>::Future, <A as Accept<I, S>>::Stream, <A as Accept<I, S>>::Service>

source§

impl<A, I, S> Accept<I, S> for RustlsAcceptor<A>
where A: Accept<I, S>, A::Stream: AsyncRead + AsyncWrite + Unpin,

Available on crate feature tls-rustls only.
§

type Stream = TlsStream<<A as Accept<I, S>>::Stream>

§

type Service = <A as Accept<I, S>>::Service

§

type Future = RustlsAcceptorFuture<<A as Accept<I, S>>::Future, <A as Accept<I, S>>::Stream, <A as Accept<I, S>>::Service>

source§

impl<I, S> Accept<I, S> for DefaultAcceptor

§

type Stream = I

§

type Service = S

§

type Future = Ready<Result<(<DefaultAcceptor as Accept<I, S>>::Stream, <DefaultAcceptor as Accept<I, S>>::Service), Error>>

source§

impl<S> Accept<TcpStream, S> for NoDelayAcceptor