pub trait AsyncReadAndWrite:
AsyncRead
+ AsyncWrite
+ Debug
+ Unpin
+ Send
+ Sync {
// Provided methods
fn try_dup(&self) -> Option<TcpStream> { ... }
fn try_into_tcp_stream(self) -> Result<TcpStream, Self>
where Self: Sized { ... }
}Provided Methods§
Sourcefn try_dup(&self) -> Option<TcpStream>
fn try_dup(&self) -> Option<TcpStream>
Optionally clone a TcpStream that represents the same underlying stream as this one. This only has an impl that returns Some for TcpStream. It is present to facilitate a workaround for some awkwardness in the SslStream implementation for the failed-handshake case.
Sourcefn try_into_tcp_stream(self) -> Result<TcpStream, Self>where
Self: Sized,
fn try_into_tcp_stream(self) -> Result<TcpStream, Self>where
Self: Sized,
Returns Ok() if the type can be converted without loss to a TcpStream, or Err(self) otherwise. This is used by the proxy server to decide whether we can use splice(2).