Merge branch 'tcpsteam_send' into 'main'

tor-rtcompat: Require that TcpStream be Send

See merge request tpo/core/arti!675
This commit is contained in:
Nick Mathewson 2022-08-15 14:13:59 +00:00
commit 8f81e22d88
3 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
BREAKING: We now require that the TcpStream type returned by listeners is Send.

View File

@ -51,7 +51,7 @@ mod net {
Ready(TcpListener),
/// We've called `accept` on the listener, and we're waiting
/// for a future to complete.
Accepting(Pin<Box<dyn Future<Output = FResult>>>),
Accepting(Pin<Box<dyn Future<Output = FResult> + Send>>),
}
impl IncomingStreams {
/// Create a new IncomingStreams from a TcpListener.

View File

@ -172,7 +172,7 @@ pub trait TcpListener {
type TcpStream: AsyncRead + AsyncWrite + Send + Sync + Unpin + 'static;
/// The type of [`stream::Stream`] returned by [`Self::incoming()`].
type Incoming: stream::Stream<Item = IoResult<(Self::TcpStream, SocketAddr)>> + Unpin;
type Incoming: stream::Stream<Item = IoResult<(Self::TcpStream, SocketAddr)>> + Send + Unpin;
/// Wait for an incoming stream; return it along with its address.
async fn accept(&self) -> IoResult<(Self::TcpStream, SocketAddr)>;