pub trait TcpListenerTrait:
Send
+ Sync
+ 'static {
type TcpStream: AsyncRead + AsyncWrite + Unpin + Send + 'static;
// Required methods
fn accept(
&self,
) -> impl Future<Output = Result<(Self::TcpStream, String), Error>> + Send;
fn local_addr(&self) -> Result<String, Error>;
}Expand description
Trait for TCP listeners that can accept connections.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl TcpListenerTrait for SimTcpListener
impl TcpListenerTrait for SimTcpListener
type TcpStream = SimTcpStream
Source§impl TcpListenerTrait for TokioTcpListener
Available on crate feature tokio-net only.
impl TcpListenerTrait for TokioTcpListener
Available on crate feature
tokio-net only.