Listener

Trait Listener 

Source
pub trait Listener {
    type Conn: AsyncRead + AsyncWrite + Send + 'static;
    type Accept<'a>: Future<Output = Option<(ConnId<'static>, Self::Conn)>> + 'a
       where Self: 'a;

    // Required method
    fn accept(&mut self) -> Self::Accept<'_>;
}
Expand description

Rproxy listener should implement this trait.

Required Associated Types§

Source

type Conn: AsyncRead + AsyncWrite + Send + 'static

Inbound connection type.

Source

type Accept<'a>: Future<Output = Option<(ConnId<'static>, Self::Conn)>> + 'a where Self: 'a

Future created by accept

Required Methods§

Source

fn accept(&mut self) -> Self::Accept<'_>

Accept next inbound connection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Listener for (TcpListener, SslAcceptor)

Source§

type Conn = SslStream<TcpStream>

Source§

type Accept<'a> = Pin<Box<dyn Future<Output = Option<(ConnId<'static>, <(TcpListener, SslAcceptor) as Listener>::Conn)>> + Send + 'a>>

Source§

fn accept(&mut self) -> Self::Accept<'_>

Source§

impl Listener for TcpListener

Source§

type Conn = TcpStream

Source§

type Accept<'a> = Pin<Box<dyn Future<Output = Option<(ConnId<'static>, <TcpListener as Listener>::Conn)>> + Send + 'a>>

Source§

fn accept(&mut self) -> Self::Accept<'_>

Implementors§