quic_rpc::transport

Trait Listener

Source
pub trait Listener: StreamTypes {
    // Required methods
    fn accept(
        &self,
    ) -> impl Future<Output = Result<(Self::SendSink, Self::RecvStream), Self::AcceptError>> + Send;
    fn local_addr(&self) -> &[LocalAddr];

    // Provided method
    fn boxed(self) -> BoxedListener<Self::In, Self::Out>
       where Self: BoxableListener<Self::In, Self::Out> + Sized + 'static { ... }
}
Expand description

A listener that listens for connections

A listener can be used to accept bidirectional typed channels from any of the currently opened connections to clients, using Listener::accept.

Required Methods§

Source

fn accept( &self, ) -> impl Future<Output = Result<(Self::SendSink, Self::RecvStream), Self::AcceptError>> + Send

Accept a new typed bidirectional channel on any of the connections we have currently opened.

Source

fn local_addr(&self) -> &[LocalAddr]

The local addresses this endpoint is bound to.

Provided Methods§

Source

fn boxed(self) -> BoxedListener<Self::In, Self::Out>
where Self: BoxableListener<Self::In, Self::Out> + Sized + 'static,

Box the listener

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: Listener, B: Listener<In = A::In, Out = A::Out>> Listener for CombinedListener<A, B>

Source§

impl<In: RpcMessage, Out: RpcMessage> Listener for BoxedListener<In, Out>

Source§

impl<In: RpcMessage, Out: RpcMessage> Listener for FlumeListener<In, Out>

Source§

impl<In: RpcMessage, Out: RpcMessage> Listener for HyperListener<In, Out>

Source§

impl<In: RpcMessage, Out: RpcMessage> Listener for IrohNetListener<In, Out>

Source§

impl<In: RpcMessage, Out: RpcMessage> Listener for DummyListener<In, Out>

Source§

impl<In: RpcMessage, Out: RpcMessage> Listener for QuinnListener<In, Out>