From 9247c32359e4f727f904c685056f116d51c95201 Mon Sep 17 00:00:00 2001 From: Marcel Springer Date: Fri, 1 Mar 2024 09:02:07 +0000 Subject: [PATCH] made PollStream Send + Sync --- sctp/src/stream/mod.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sctp/src/stream/mod.rs b/sctp/src/stream/mod.rs index 19984d6fb..9530a24b0 100644 --- a/sctp/src/stream/mod.rs +++ b/sctp/src/stream/mod.rs @@ -527,7 +527,7 @@ enum ReadFut { /// Nothing in progress. Idle, /// Reading data from the underlying stream. - Reading(Pin>> + Send>>), + Reading(Pin>> + Send + Sync>>), /// Finished reading, but there's unread data in the temporary buffer. RemainingData(Vec), } @@ -536,7 +536,9 @@ enum ShutdownFut { /// Nothing in progress. Idle, /// Reading data from the underlying stream. - ShuttingDown(Pin>>>), + ShuttingDown( + Pin> + Send + Sync>>, + ), /// Shutdown future has run Done, Errored(crate::error::Error), @@ -548,7 +550,9 @@ impl ReadFut { /// # Panics /// /// Panics if `ReadFut` variant is not `Reading`. - fn get_reading_mut(&mut self) -> &mut Pin>> + Send>> { + fn get_reading_mut( + &mut self, + ) -> &mut Pin>> + Send + Sync>> { match self { ReadFut::Reading(ref mut fut) => fut, _ => panic!("expected ReadFut to be Reading"), @@ -564,7 +568,9 @@ impl ShutdownFut { /// Panics if `ShutdownFut` variant is not `ShuttingDown`. fn get_shutting_down_mut( &mut self, - ) -> &mut Pin>>> { + ) -> &mut Pin< + Box> + Send + Sync>, + > { match self { ShutdownFut::ShuttingDown(ref mut fut) => fut, _ => panic!("expected ShutdownFut to be ShuttingDown"), @@ -581,7 +587,7 @@ pub struct PollStream { stream: Arc, read_fut: ReadFut, - write_fut: Option>>>>, + write_fut: Option> + Send + Sync>>>, shutdown_fut: ShutdownFut, read_buf_cap: usize,