TlsStream implements Read and Write. However, &TlsStream doesn't, unlike &std::net::TcpStream.
Is it possible to implement these traits for references to TlsStream as well?
Use case: I need to share a TlsStream accross 2 threads. I want to read from it in one thread, and write to it in another. Unfortunately, this means that I have to use a Mutex to synchronize access, which leads to deadlock if the reading thread is blocking, waiting for data that won't come until the writing thread sends something.
TlsStream
implements Read and Write. However,&TlsStream
doesn't, unlike&std::net::TcpStream
.Is it possible to implement these traits for references to
TlsStream
as well?Use case: I need to share a TlsStream accross 2 threads. I want to read from it in one thread, and write to it in another. Unfortunately, this means that I have to use a Mutex to synchronize access, which leads to deadlock if the reading thread is blocking, waiting for data that won't come until the writing thread sends something.
Related SO post
Thank you!