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§
Sourcefn accept(
&self,
) -> impl Future<Output = Result<(Self::SendSink, Self::RecvStream), Self::AcceptError>> + Send
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.
Sourcefn local_addr(&self) -> &[LocalAddr]
fn local_addr(&self) -> &[LocalAddr]
The local addresses this endpoint is bound to.
Provided Methods§
Sourcefn boxed(self) -> BoxedListener<Self::In, Self::Out>
fn boxed(self) -> BoxedListener<Self::In, Self::Out>
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.