Skip to content

Upgrading mio 0.4 to 0.5

Breaking0.4.4 → 0.5.1Breaking7Platform1New1Changed4Fixed1

BreakingUpgrade verdict

7 breaking changes and a platform requirement change.

  • The method for registering event sources has a new name.
  • Configuration is now set through builder methods instead of struct fields, and the config can no longer be copied implicitly.
  • The TcpSocket type is no longer exported for callers to use.
  • Types from the bytes crate are no longer re-exported, so import them from bytes directly.
Top 4 of 8 that need code or config changes
Breaking7
Renames EventLoop::register_opt to EventLoop::register.
EventLoop::register_optEventLoop::register
Makes EventLoopConfig a builder without public fields and no longer Copy.
EventLoopConfig
Removes TcpSocket from the public API.
TcpSocket
Stops re-exporting bytes types.
TcpListener::accept now also returns the remote peer address.
TcpListeneraccept
UdpSocket::{send_to, recv_from} take slices directly and return byte counts.
UdpSocket::send_toUdpSocket::recv_fromBufMutBuf
Permanently associates mio's socket types with an EventLoop.
Platform1
Adds Android support.