pub trait SocketListener:
Sized
+ Send
+ Sync {
type Stream: SocketStream + 'static;
// Required methods
fn bind<'life0, 'async_trait>(
addr: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,
'life0: 'async_trait;
fn accept<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(Self::Stream, SocketAddr)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The TcpListener interface we need to mock
Required Associated Types§
Sourcetype Stream: SocketStream + 'static
type Stream: SocketStream + 'static
The associated listener interface to be mocked too
Required Methods§
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.