Skip to content

Commit 014ae6e

Browse files
committed
Make it easier to use IronRDP with Tokio
1 parent 55176ff commit 014ae6e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

crates/ironrdp-async/src/framed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ pub trait FramedRead {
1111
fn read<'a>(
1212
&'a mut self,
1313
buf: &'a mut BytesMut,
14-
) -> Pin<Box<dyn std::future::Future<Output = io::Result<usize>> + 'a>>
14+
) -> Pin<Box<dyn std::future::Future<Output = io::Result<usize>> + 'a + Send>>
1515
where
1616
Self: 'a;
1717
}
1818

1919
pub trait FramedWrite {
2020
/// Writes an entire buffer into this stream.
21-
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> Pin<Box<dyn std::future::Future<Output = io::Result<()>> + 'a>>
21+
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> Pin<Box<dyn std::future::Future<Output = io::Result<()>> + 'a + Send>>
2222
where
2323
Self: 'a;
2424
}

crates/ironrdp-futures/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<S> FramedWrite for FuturesStream<S>
6161
where
6262
S: Unpin + AsyncWrite,
6363
{
64-
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> Pin<Box<dyn std::future::Future<Output = io::Result<()>> + 'a>>
64+
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> Pin<Box<dyn std::future::Future<Output = io::Result<()>> + 'a + Send>>
6565
where
6666
Self: 'a,
6767
{

crates/ironrdp-pdu/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ pub fn find_size(bytes: &[u8]) -> PduResult<Option<PduInfo>> {
282282
}
283283
}
284284

285-
pub trait PduHint: core::fmt::Debug {
285+
pub trait PduHint: core::fmt::Debug + Sync {
286286
/// Finds next PDU size by reading the next few bytes.
287287
fn find_size(&self, bytes: &[u8]) -> PduResult<Option<usize>>;
288288
}

crates/ironrdp-tokio/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ impl<S> StreamWrapper for TokioStream<S> {
3333

3434
impl<S> FramedRead for TokioStream<S>
3535
where
36-
S: Unpin + AsyncRead,
36+
S: Unpin + AsyncRead + Send,
3737
{
3838
fn read<'a>(
3939
&'a mut self,
4040
buf: &'a mut BytesMut,
41-
) -> Pin<Box<dyn std::future::Future<Output = io::Result<usize>> + 'a>>
41+
) -> Pin<Box<dyn std::future::Future<Output = io::Result<usize>> + 'a + Send>>
4242
where
43-
Self: 'a,
43+
Self: 'a + Send,
4444
{
4545
use tokio::io::AsyncReadExt as _;
4646

@@ -50,9 +50,9 @@ where
5050

5151
impl<S> FramedWrite for TokioStream<S>
5252
where
53-
S: Unpin + AsyncWrite,
53+
S: Unpin + AsyncWrite + Send,
5454
{
55-
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> Pin<Box<dyn std::future::Future<Output = io::Result<()>> + 'a>>
55+
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> Pin<Box<dyn std::future::Future<Output = io::Result<()>> + 'a + Send>>
5656
where
5757
Self: 'a,
5858
{

0 commit comments

Comments
 (0)