tokio-compat
tokio-compat copied to clipboard
Compat for io
I need a compat layer for io::AsyncWrite and io::AsyncRead. Can you add it?
@MOZGIII are you trying to adapt between tokio 0.1's Async{Read, Write} traits and tokio 0.2's? I'd definitely like to add this to tokio-compat; thanks for opening the issue.
In the meantime, a potential workaround is to use futures 0.3's io compat layer to turn tokio 0.1 AsyncRead and AsyncWrite into futures 0.3's versions, and then use tokio-util's compat module to convert the futures 0.3 AsyncRead/AsyncWrite traits into tokio 0.2's versions.
Of course, this is not ideal, and we should definitely provide a one-step compat layer here, but it'll work in the short term.
Thanks! I couldn't figure this out, this should work for my current use case.