pub trait ServerEndpoint<In, Out>: ConnectionCommon<In, Out> {
// Required methods
fn accept(
&self,
) -> impl Future<Output = Result<(Self::SendSink, Self::RecvStream), Self::OpenError>> + Send;
fn local_addr(&self) -> &[LocalAddr];
}
Expand description
A server endpoint that listens for connections
A server endpoint can be used to accept bidirectional typed channels from any of the
currently opened connections to clients, using ServerEndpoint::accept
.
Required Methods§
Sourcefn accept(
&self,
) -> impl Future<Output = Result<(Self::SendSink, Self::RecvStream), Self::OpenError>> + Send
fn accept( &self, ) -> impl Future<Output = Result<(Self::SendSink, Self::RecvStream), Self::OpenError>> + 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.
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.