Trait poem::listener::Acceptor

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

    // Required methods
    fn local_addr(&self) -> Vec<LocalAddr>;
    fn accept(
        &mut self
    ) -> impl Future<Output = IoResult<(Self::Io, LocalAddr, RemoteAddr, Scheme)>> + Send;
}
Available on crate feature server only.
Expand description

Represents a acceptor type.

Required Associated Types§

source

type Io: AsyncRead + AsyncWrite + Send + Unpin + 'static

IO stream type.

Required Methods§

source

fn local_addr(&self) -> Vec<LocalAddr>

Returns the local address that this listener is bound to.

source

fn accept( &mut self ) -> impl Future<Output = IoResult<(Self::Io, LocalAddr, RemoteAddr, Scheme)>> + Send

Accepts a new incoming connection from this listener.

This function will yield once a new TCP connection is established. When established, the corresponding IO stream and the remote peer’s address will be returned.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Acceptor for Infallible

§

type Io = BoxIo

source§

fn local_addr(&self) -> Vec<LocalAddr>

source§

async fn accept( &mut self ) -> IoResult<(Self::Io, LocalAddr, RemoteAddr, Scheme)>

source§

impl<T: Acceptor + ?Sized> Acceptor for Box<T>

§

type Io = <T as Acceptor>::Io

source§

fn local_addr(&self) -> Vec<LocalAddr>

source§

async fn accept( &mut self ) -> IoResult<(Self::Io, LocalAddr, RemoteAddr, Scheme)>

Implementors§

source§

impl Acceptor for TcpAcceptor

source§

impl Acceptor for UnixAcceptor

source§

impl Acceptor for dyn DynAcceptor + '_

§

type Io = BoxIo

source§

impl<A: Acceptor, B: Acceptor> Acceptor for Combined<A, B>

§

type Io = CombinedStream<<A as Acceptor>::Io, <B as Acceptor>::Io>

source§

impl<T, S> Acceptor for NativeTlsAcceptor<T, S>
where S: Stream<Item = NativeTlsConfig> + Send + Unpin + 'static, T: Acceptor,

source§

impl<T, S> Acceptor for OpensslTlsAcceptor<T, S>
where S: Stream<Item = OpensslTlsConfig> + Send + Unpin + 'static, T: Acceptor,

source§

impl<T, S> Acceptor for RustlsAcceptor<T, S>
where S: Stream<Item = RustlsConfig> + Send + Unpin + 'static, T: Acceptor,

source§

impl<T: Acceptor> Acceptor for AutoCertAcceptor<T>

Available on crate feature acme-base only.