pub trait ListenerProvider {
    type Listener: StreamAccept + 'static;

    // Required method
    fn bind<A: ToSocketAddrs + Send>(
        addr: A
    ) -> impl Future<Output = Result<Self::Listener, Error>> + Send;
}
Expand description

Provides an abstraction for bind

Required Associated Types§

source

type Listener: StreamAccept + 'static

Listener obtained after bind

Required Methods§

source

fn bind<A: ToSocketAddrs + Send>( addr: A ) -> impl Future<Output = Result<Self::Listener, Error>> + Send

Getting the Listener through a binding, the only difference between this process and tokio::net::TcpListener::bind is that it will be resolved through a customized dns service

Object Safety§

This trait is not object safe.

Implementors§