Trait salvo_core::conn::Acceptor

source ·
pub trait Acceptor {
    type Conn: HttpConnection + AsyncRead + AsyncWrite + Send + Unpin + 'static;

    // Required methods
    fn holdings(&self) -> &[Holding];
    fn accept(
        &mut self,
        fuse_factory: Option<Arc<dyn FuseFactory + Sync + Send + 'static>>
    ) -> impl Future<Output = IoResult<Accepted<Self::Conn>>> + Send;
}
Expand description

Acceptor represents an acceptor that can accept incoming connections.

Required Associated Types§

source

type Conn: HttpConnection + AsyncRead + AsyncWrite + Send + Unpin + 'static

Conn type

Required Methods§

source

fn holdings(&self) -> &[Holding]

Returns the holding information that this listener is bound to.

source

fn accept( &mut self, fuse_factory: Option<Arc<dyn FuseFactory + Sync + Send + 'static>> ) -> impl Future<Output = IoResult<Accepted<Self::Conn>>> + Send

Accepts a new incoming connection from this listener.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Acceptor for TcpAcceptor

source§

impl Acceptor for UnixAcceptor

Available on Unix only.
source§

impl<S, C, E> Acceptor for QuinnAcceptor<S, C, E>
where S: Stream<Item = C> + Send + Unpin + 'static, C: TryInto<ServerConfig, Error = E> + Send + 'static, E: StdError + Send,

Available on crate feature quinn only.
source§

impl<S, C, T, E> Acceptor for NativeTlsAcceptor<S, C, T, E>
where S: Stream<Item = C> + Send + Unpin + 'static, C: TryInto<Identity, Error = E> + Send + 'static, T: Acceptor + Send + 'static, <T as Acceptor>::Conn: AsyncRead + AsyncWrite + Unpin + Send, E: StdError + Send,

Available on crate feature native-tls only.
source§

impl<S, C, T, E> Acceptor for OpensslAcceptor<S, C, T, E>
where S: Stream<Item = C> + Send + Unpin + 'static, C: TryInto<SslAcceptorBuilder, Error = E> + Send + 'static, T: Acceptor + Send + 'static, E: StdError + Send,

Available on crate feature openssl only.
source§

impl<S, C, T, E> Acceptor for RustlsAcceptor<S, C, T, E>
where S: Stream<Item = C> + Send + Unpin + 'static, C: TryInto<ServerConfig, Error = E> + Send + 'static, T: Acceptor + Send + 'static, <T as Acceptor>::Conn: AsyncRead + AsyncWrite + Send + Unpin + 'static, E: StdError + Send,

Available on crate feature rustls only.