Skip to main content

ListenerProvider

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

Bind a listener from address/hostname.

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§