pub trait SocketStream:
Sized
+ Send
+ Sync {
// Required methods
fn connect<'life0, 'async_trait>(
addr: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + 'static + 'async_trait,
'life0: 'async_trait;
fn into_split(self) -> (ReadStream, WriteStream);
}
Expand description
The TcpStream interface we need to mock
Required Methods§
Sourcefn connect<'life0, 'async_trait>(
addr: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: Sized + 'static + 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
addr: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: Sized + 'static + 'async_trait,
'life0: 'async_trait,
Opens a TCP connection to a remote host.
Sourcefn into_split(self) -> (ReadStream, WriteStream)
fn into_split(self) -> (ReadStream, WriteStream)
Splits the inner TcpStream
into a read half and a write half, which
can be used to read and write the stream concurrently.
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.