pub trait ConnListener: Send + Sync {
type Message;
type Error;
// Required methods
fn local_endpoint(&self) -> Result<Endpoint, Self::Error>;
fn accept<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Conn<Self::Message, Self::Error>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
ConnListener is a generic network listener interface for
[tcp::TcpConn
], [tls::TlsConn
], [ws::WsConn
], and [unix::UnixConn
].
Required Associated Types§
Required Methods§
fn local_endpoint(&self) -> Result<Endpoint, Self::Error>
fn accept<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Conn<Self::Message, Self::Error>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Trait Implementations§
Source§impl<C, E> From<TcpListener<C>> for Box<dyn ConnListener<Message = C::Message, Error = E>>
impl<C, E> From<TcpListener<C>> for Box<dyn ConnListener<Message = C::Message, Error = E>>
Source§fn from(listener: TcpListener<C>) -> Self
fn from(listener: TcpListener<C>) -> Self
Converts to this type from the input type.