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
Currently, this function takes port object through a shared reference.
To my mind, it is not good, because port internal state does mutate after read() (e.g. read is not idempotent, which is unusual for &-functions).
Since Port is Sync, user can by mistake read from port on multiple threads and get strange behaviour.
Finally, this is inconsistent with other similar APIs, like cpuio::Port::read, and std::io::Read::read.
The text was updated successfully, but these errors were encountered:
Currently, this function takes port object through a shared reference.
To my mind, it is not good, because port internal state does mutate after read() (e.g. read is not idempotent, which is unusual for &-functions).
Since Port is Sync, user can by mistake read from port on multiple threads and get strange behaviour.
Finally, this is inconsistent with other similar APIs, like cpuio::Port::read, and std::io::Read::read.
The text was updated successfully, but these errors were encountered: