Trait ListenerProvider

Source
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

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.

Implementors§