diff --git a/crates/ironrdp-async/src/framed.rs b/crates/ironrdp-async/src/framed.rs index 8d0f48a2..beeed729 100644 --- a/crates/ironrdp-async/src/framed.rs +++ b/crates/ironrdp-async/src/framed.rs @@ -209,10 +209,14 @@ where } } -impl Framed +impl FramedWrite for Framed where S: FramedWrite, { + type WriteAllFut<'write> = S::WriteAllFut<'write> + where + Self: 'write; + /// Attempts to write an entire buffer into this `Framed`’s stream. /// /// # Cancel safety @@ -222,8 +226,8 @@ where /// branch completes first, then the provided buffer may have been /// partially written, but future calls to `write_all` will start over /// from the beginning of the buffer. - pub async fn write_all(&mut self, buf: &[u8]) -> io::Result<()> { - self.stream.write_all(buf).await + fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteAllFut<'a> { + self.stream.write_all(buf) } } diff --git a/crates/ironrdp-client/src/rdp.rs b/crates/ironrdp-client/src/rdp.rs index 021ada4d..6c5cf28c 100644 --- a/crates/ironrdp-client/src/rdp.rs +++ b/crates/ironrdp-client/src/rdp.rs @@ -10,7 +10,7 @@ use ironrdp::session::{fast_path, ActiveStage, ActiveStageOutput, GracefulDiscon use ironrdp::{cliprdr, connector, rdpdr, rdpsnd, session}; use ironrdp_core::WriteBuf; use ironrdp_rdpsnd_native::cpal; -use ironrdp_tokio::{single_sequence_step_read, split_tokio_framed}; +use ironrdp_tokio::{single_sequence_step_read, split_tokio_framed, FramedWrite}; use rdpdr::NoopRdpdrBackend; use smallvec::SmallVec; use tokio::net::TcpStream; diff --git a/crates/ironrdp-web/src/session.rs b/crates/ironrdp-web/src/session.rs index 905a320f..67529705 100644 --- a/crates/ironrdp-web/src/session.rs +++ b/crates/ironrdp-web/src/session.rs @@ -27,7 +27,7 @@ use ironrdp::pdu::rdp::client_info::PerformanceFlags; use ironrdp::session::image::DecodedImage; use ironrdp::session::{fast_path, ActiveStage, ActiveStageOutput, GracefulDisconnectReason}; use ironrdp_core::WriteBuf; -use ironrdp_futures::single_sequence_step_read; +use ironrdp_futures::{single_sequence_step_read, FramedWrite}; use rgb::AsPixels as _; use tap::prelude::*; use wasm_bindgen::prelude::*; @@ -958,7 +958,7 @@ async fn connect_rdcleanpath( pcb: Option, ) -> Result<(ironrdp_futures::Upgraded, Vec), IronRdpError> where - S: ironrdp_futures::FramedRead + ironrdp_futures::FramedWrite, + S: ironrdp_futures::FramedRead + FramedWrite, { use ironrdp::connector::Sequence as _; use x509_cert::der::Decode as _;