Listener

Trait Listener 

Source
pub trait Listener {
    type Acceptor: Acceptor;

    // Required method
    fn try_bind(
        self,
    ) -> impl Future<Output = Result<Self::Acceptor, Error>> + Send;

    // Provided methods
    fn bind(self) -> impl Future<Output = Self::Acceptor> + Send
       where Self: Sized + Send { ... }
    fn join<T>(self, other: T) -> JoinedListener<Self, T>
       where Self: Sized + Send { ... }
}
Expand description

Listener represents a listener that can bind to a specific address and port and return an acceptor.

Required Associated Types§

Source

type Acceptor: Acceptor

Acceptor type.

Required Methods§

Source

fn try_bind(self) -> impl Future<Output = Result<Self::Acceptor, Error>> + Send

Bind and returns acceptor.

Provided Methods§

Source

fn bind(self) -> impl Future<Output = Self::Acceptor> + Send
where Self: Sized + Send,

Bind and returns acceptor.

Source

fn join<T>(self, other: T) -> JoinedListener<Self, T>
where Self: Sized + Send,

Join current Listener with the other.

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§

Source§

impl<A, B> Listener for JoinedListener<A, B>
where A: Listener + Send + Unpin + 'static, B: Listener + Send + Unpin + 'static, <A as Listener>::Acceptor: Acceptor + Send + Unpin + 'static, <B as Listener>::Acceptor: Acceptor + Send + Unpin + 'static,

Source§

type Acceptor = JoinedAcceptor<<A as Listener>::Acceptor, <B as Listener>::Acceptor>

Source§

impl<S, C, T, E> Listener for NativeTlsListener<S, C, T, E>
where S: IntoConfigStream<C> + Send + 'static, C: TryInto<Identity, Error = E> + Send + 'static, T: Listener + Send, <T as Listener>::Acceptor: Send + 'static, E: Error + Send,

Source§

type Acceptor = NativeTlsAcceptor<Pin<Box<dyn Stream<Item = C> + Send>>, C, <T as Listener>::Acceptor, E>

Source§

impl<S, C, T, E> Listener for OpensslListener<S, C, T, E>
where S: IntoConfigStream<C> + Send + 'static, C: TryInto<SslAcceptorBuilder, Error = E> + Send + 'static, T: Listener + Send, <T as Listener>::Acceptor: Send + 'static, E: Error + Send,

Source§

type Acceptor = OpensslAcceptor<Pin<Box<dyn Stream<Item = C> + Send>>, C, <T as Listener>::Acceptor, E>

Source§

impl<S, C, T, E> Listener for QuinnListener<S, C, T, E>
where S: IntoConfigStream<C> + Send + 'static, C: TryInto<ServerConfig, Error = E> + Send + 'static, T: ToSocketAddrs + Send, E: Error + Send,

Source§

type Acceptor = QuinnAcceptor<Pin<Box<dyn Stream<Item = C> + Send>>, C, <C as TryInto<ServerConfig>>::Error>

Source§

impl<S, C, T, E> Listener for RustlsListener<S, C, T, E>
where S: IntoConfigStream<C> + Send + 'static, C: TryInto<ServerConfig, Error = E> + Send + 'static, T: Listener + Send, <T as Listener>::Acceptor: Send + 'static, E: Error + Send,

Source§

type Acceptor = RustlsAcceptor<Pin<Box<dyn Stream<Item = C> + Send>>, C, <T as Listener>::Acceptor, E>

Source§

impl<T> Listener for AcmeListener<T>
where T: Listener + Send, <T as Listener>::Acceptor: Send + 'static,

Source§

type Acceptor = AcmeAcceptor<<T as Listener>::Acceptor>

Source§

impl<T> Listener for TcpListener<T>
where T: ToSocketAddrs + Send,

Source§

impl<T> Listener for UnixListener<T>
where T: AsRef<Path> + Send + Clone,

Source§

impl<T, A> Listener for AcmeQuinnListener<T, A>
where T: Listener + Send, <T as Listener>::Acceptor: Send + Unpin + 'static, A: ToSocketAddrs + Send,

Source§

type Acceptor = JoinedAcceptor<AcmeAcceptor<<T as Listener>::Acceptor>, QuinnAcceptor<Pin<Box<dyn Stream<Item = ServerConfig> + Send>>, ServerConfig, Infallible>>