Skip to main content

Acceptor

Trait Acceptor 

pub trait Acceptor:
    Send
    + Sync
    + 'static {
    type Stream: Io;

    // Required methods
    fn local_addr(&self) -> Result<SocketAddress, Error>;
    fn accept(
        self,
    ) -> impl Future<Output = Result<(Self::Stream, SocketAddress), Error>> + Send;
}
Available on crate feature socks5 only.
Expand description

Acceptor created by an factory Service in function of a bind Service.

Required Associated Types§

type Stream: Io

The Io returned by this Acceptor.

Required Methods§

fn local_addr(&self) -> Result<SocketAddress, Error>

Returns the local address that this listener is bound to.

fn accept( self, ) -> impl Future<Output = Result<(Self::Stream, SocketAddress), Error>> + Send

Returns the first succesfully accepted connection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§