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 replacesReady
in registering event sources.Registry
structure that separates the registering and polling functionality.- ๐
Waker
structure that allows another thread to wake a thread pollingPoll
. - Unix Domain Socket (UDS) types:
UnixDatagram
,UnixListener
andUnixStream
.
โ 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 intoReady
. - ๐ Custom user-space readiness queue was removed, this includes the public
Registration
andSetReadiness
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. InsteadPoll::poll
will now return an error if one occurs. - ๐
From<usize>
is removed fromToken
, the internal field is still public, soToken(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 leastevent::Source
andPoll
. - 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 variousis_*
methods onEvent
. For example instead checking for readable readiness usingEvent::ready().is_readable()
, you would callEvent::is_readable()
. - ๐
Ready::is_hup
was removed in favour ofEvent::is_read_closed
andEvent::is_write_closed
. - The Iterator implementation of
Events
was changed to return&Event
. Evented
was renamed toevent::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 usetcp
,udp
and/oruds
. For more documentation on the features see thefeature
module in the API documentation (requires theextra-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 ofEvents
is now actually useful as it prints allEvent
s.