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
{{ message }}
This repository was archived by the owner on May 6, 2018. It is now read-only.
Many of the methods on io::Read and io::Write, such as write_all, are not appropriate to call in an async context. Furthermore, lots of code using io::Read and io::Write expects (correctly or not) that those interfaces are blocking. Removing the supertraits would make it harder to misuse the AsyncRead and AsyncWrite types as io::Read and io::Write types, and would allow moving the io::XXX functions to methods on the AsyncRead and AsyncWrite traits (this last point is a benefit because methods are more easily discoverable than free functions). This change could also allow AsyncRead and AsyncWrite types with non-io::Error error types.
There are places in which it makes sense to provide an async-readable/writeable type as an io::Read or io::Write. That functionality can still be provided by choosing to opt-in to an io::Read or io::Write impl, or by using some form of wrapper type which allows using an AsyncRead/AsyncWrite as an io::Read/io::Write (basically the inverse of #76).
Many of the methods on
io::Readandio::Write, such aswrite_all, are not appropriate to call in an async context. Furthermore, lots of code usingio::Readandio::Writeexpects (correctly or not) that those interfaces are blocking. Removing the supertraits would make it harder to misuse theAsyncReadandAsyncWritetypes asio::Readandio::Writetypes, and would allow moving theio::XXXfunctions to methods on theAsyncReadandAsyncWritetraits (this last point is a benefit because methods are more easily discoverable than free functions). This change could also allowAsyncReadandAsyncWritetypes with non-io::Errorerror types.There are places in which it makes sense to provide an async-readable/writeable type as an
io::Readorio::Write. That functionality can still be provided by choosing to opt-in to anio::Readorio::Writeimpl, or by using some form of wrapper type which allows using anAsyncRead/AsyncWriteas anio::Read/io::Write(basically the inverse of #76).cc @carllerche