You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux 4.19.9-arch1-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux
Description
tokio_io::AsyncRead allows to split itself into a ReadHalf and WriteHalf if Self also implements tokio_io::AsyncWrite. However I did not see a way to reunite the two halves back into the original type. The split functionality is implemented using futures::sync::Bilock which does provide a reunite method. It would be nice if tokio-io would also allow getting back the original type, e.g. via a reunite function in tokio-io/src/split.rs
/// Reunite the two halves of a previously split resource.pubfnreunite<T>(r:ReadHalf<T>,w:WriteHalf<T>) -> Result<T,(ReadHalf<T>,WriteHalf<T>)>{
r.handle.reunite(w.handle).map_err(|err| {(ReadHalf{handle: err.0},WriteHalf{handle: err.1})})}
I would be happy to open a PR implementing this if there is a chance of getting this merged.
The text was updated successfully, but these errors were encountered:
Version
tokio-io 0.1.10
Platform
Linux 4.19.9-arch1-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux
Description
tokio_io::AsyncRead
allows to split itself into aReadHalf
andWriteHalf
ifSelf
also implementstokio_io::AsyncWrite
. However I did not see a way to reunite the two halves back into the original type. The split functionality is implemented usingfutures::sync::Bilock
which does provide a reunite method. It would be nice iftokio-io
would also allow getting back the original type, e.g. via areunite
function intokio-io/src/split.rs
I would be happy to open a PR implementing this if there is a chance of getting this merged.
The text was updated successfully, but these errors were encountered: