MIO v0.7.0 Release Notes

Release Date: 2020-03-02 // about 4 years ago
  • ๐Ÿ”– Version 0.7 of Mio contains various major changes compared to version 0.6. Overall a large number of API changes have been made to reduce the complexity of ๐Ÿšš the implementation and remove overhead where possible.

    Please refer to the blog post about 0.7-alpha.1 for additional information.

    โž• Added

    • Interest structure that replaces Ready in registering event sources.
    • Registry structure that separates the registering and polling functionality.
    • ๐Ÿ“Š Waker structure that allows another thread to wake a thread polling Poll.
    • Unix Domain Socket (UDS) types: UnixDatagram, UnixListener and UnixStream.

    โœ‚ Removed

    • ๐Ÿšš All code deprecated in 0.6 was removed in 0.7.
    • ๐Ÿ‘Œ Support for Fuchsia was removed as the code was unmaintained.
    • ๐Ÿ‘Œ Support for Bitrig was removed, rustc dropped support for it also.
    • ๐Ÿ”€ UnixReady was merged into Ready.
    • ๐Ÿšš Custom user-space readiness queue was removed, this includes the public Registration and SetReadiness types.
    • โฌ†๏ธ PollOpt was removed and all registrations use edge-triggers. See the upgrade guide on how to process event using edge-triggers.
    • ๐Ÿ‘ The network types (types in the net module) now support only the same API as found in the standard library, various methods on the types were removed.
    • ๐Ÿ‘ TcpStream now supports vectored I/O.
    • ๐Ÿšš Poll::poll_interruptible was removed. Instead Poll::poll will now return an error if one occurs.
    • ๐Ÿšš From<usize> is removed from Token, the internal field is still public, so Token(my_token) can still be used.

    ๐Ÿ”„ Changed

    • ๐Ÿ“š Various documentation improvements were made around correct usage of Poll and registered event sources. It is recommended to reread the documentation of at least event::Source and Poll.
    • Mio now uses Rust 2018 and rustfmt for all code.
    • Event was changed to be a wrapper around the OS event. This means it can be significantly larger on some OSes.
    • ๐Ÿšš Ready was removed and replaced with various is_* methods on Event. For example instead checking for readable readiness using Event::ready().is_readable(), you would call Event::is_readable().
    • ๐Ÿšš Ready::is_hup was removed in favour of Event::is_read_closed and Event::is_write_closed.
    • The Iterator implementation of Events was changed to return &Event.
    • Evented was renamed to event::Source and now takes mutable reference to the source.
    • ๐Ÿ‘ Minimum supported Rust version was increased to 1.39.
    • 0๏ธโƒฃ By default Mio now uses a shim implementation. To enable the full implementation, that uses the OS, enable the os-oll feature. To enable the network types use tcp, udp and/or uds. For more documentation on the features see the feature module in the API documentation (requires the extra-docs feature).
    • ๐Ÿ The entire Windows implementation was rewritten.
    • Various optimisation were made to reduce the number of system calls in creating and using sockets, e.g. making use of accept4(2).
    • The fmt::Debug implementation of Events is now actually useful as it prints all Events.