poll(2) implementation on AIX, removing the need for using mio_unsupported_force_poll_poll (https://github.com/tokio-rs/mio/pull/1833).--no-default-features --features os-ext (https://github.com/tokio-rs/mio/pull/1828).cfg sitations easier to follow (https://github.com/tokio-rs/mio/pull/1812, https://github.com/tokio-rs/mio/pull/1813).With v1 Mio is able to bump its MSRV to 1.70, allowing us to implement I/O safety traits (https://github.com/rust-lang/rust/issues/87074) and replace SocketAddr with the version found in the standard library.
AsFd forTcpListener, TcpStream, UdpSocket, UnixDatagram, UnixListener, UnixStream, pipe::Receiver and pipe::Sender (https://github.com/tokio-rs/mio/pull/1749, https://github.com/tokio-rs/mio/pull/1797).From for TcpListener, TcpStream, UdpSocket, UnixDatagram, UnixListener, and UnixStream for their standard library counterpart (https://github.com/tokio-rs/mio/pull/1767).SocketAddr type is removed in favour of std::os::unix::net::SocketAddr (https://github.com/tokio-rs/mio/pull/1760). All methods on Mio's version should exist on the version in the standard library.UnixDatagram::{local_addr,peer_addr,bind_addr,recv_from}, UnixListener::{local_addr,bind_addr,accept} and UnixStream::{local_addr,peer_addr,connect_addr} return and/or use std::os::unix::net::SocketAddr instead of Mio's own SocketAddr type (https://github.com/tokio-rs/mio/pull/1760).OwnedFd internally for Poll where possible (https://github.com/tokio-rs/mio/pull/1749).{UnixListener,UnixStream}:bind_addr (https://github.com/tokio-rs/mio/pull/1630).mio_unsupported_force_poll_poll and mio_unsupported_force_waker_pipe unsupported configuration flags to force a specific poll or waker implementation (https://github.com/tokio-rs/mio/pull/1684, https://github.com/tokio-rs/mio/pull/1685, https://github.com/tokio-rs/mio/pull/1692).pipe(2) based waker (swapped file descriptors) (https://github.com/tokio-rs/mio/pull/1722).Registrys. (https://github.com/tokio-rs/mio/pull/1706).log dependency optional behind the log feature flag (enabled by default). Users that disabled Mio‘s default features will now not see any logging from Mio, enabling the log feature will fix that. This was done in response to the log crate increasing it’s MSRV to v1.60, see https://github.com/rust-lang/log/pull/552 (https://github.com/tokio-rs/mio/pull/1673).Poll::poll when using Duration::MAX as timeout (https://github.com/tokio-rs/mio/pull/1657).Interest::PRIORITY on Linux and Android, to trigger Event::is_priority (https://github.com/tokio-rs/mio/pull/1647).Poll::poll (https://github.com/tokio-rs/mio/pull/1642).windows-sys to 0.42.0 (https://github.com/tokio-rs/mio/pull/1624).epoll\_create1 on Android API level < 21. (https://github.com/tokio-rs/mio/pull/1590).Registery::try_clone on wasm32-wasi (https://github.com/tokio-rs/mio/pull/1576).winapi dependency with windows-sys. (https://github.com/tokio-rs/mio/pull/1556).TcpStream::connect (https://github.com/tokio-rs/mio/pull/1565).try_io method to all I/O types (#1551). This execute a user defined I/O closure while updating Mio's internal state ensuring that the I/O type receives more events if it hits a WouldBlock error. This is added to the following types:TcpStreamUdpSocketUnixDatagramUnixStreamunix::pipe::Senderunix::pipe::Receiverwasm32-wasi target (#1549). Note that a lot of time type are still missing, e.g. the Waker, and may never be possible to implement.TcpSocket type (https://github.com/tokio-rs/mio/commit/02e9be41f27daf822575444fdd2b3067433a5996). The socket2 crate provides all the functionality and more.UdpSocket::peer_addr (https://github.com/tokio-rs/mio/commit/5fc104d08e0e74c8a19247f7cba0f058699fc438).sys::unix::SocketAddr::as_abstract_namespace() (#1520).Registry::try_clone invalid usage of F_DUPFD_CLOEXEC (#1497, https://github.com/tokio-rs/mio/commit/2883f5c1f35bf1a59682c5ffc4afe6b97d7d6e68).FD_CLOEXEC when calling Registry::try_clone (https://github.com/tokio-rs/mio/commit/d1617b567ff6bc669d71e367d22e0e93ff7e2e24 for epoll and (https://github.com/tokio-rs/mio/commit/b367a05e408ca90a26383c3aa16d8a16f019dc59 for kqueue).NamedPipe::write (https://github.com/tokio-rs/mio/commit/aec872be9732e5c6685100674278be27f54a271b).accept(2) on x86 Android instead of accept4(2) (https://github.com/tokio-rs/mio/commit/6f86b925d3e48f30905d5cfa54348acf3f1fa036, https://github.com/tokio-rs/mio/commit/8d5414880ab82178305ac1d2c16d715e58633d3e).TcpStream::set_linger on macOS (https://github.com/tokio-rs/mio/commit/175773ce02e85977db81224c782c8d140aba8543).UdpSocket::only_v6 (https://github.com/tokio-rs/mio/commit/0101e05a800f17fb88f4315d9b9fe0f08cca6e57).Clone implementation for Event (https://github.com/tokio-rs/mio/commit/26540ebbae89df6d4d08465c56f715d8f2addfc3).AsRawFd implementation for Registry (https://github.com/tokio-rs/mio/commit/f70daa72da0042b1880256164774c3286d315a02).Read and Write implementation for &unix::pipe::Sender and Receiver, that is on the reference to them, an implementation existed on the types themselves already (https://github.com/tokio-rs/mio/commit/1be481dcbbcb6906364008b5d61e7f53cddc3eb3).SocketAddr::address (https://github.com/tokio-rs/mio/commit/6d3fa69240cd4bb95e9d34605c660c30245a18bd).Waker::wake works on illumos systems with poor pipe(2) and epoll(2) interaction using EPOLLET (https://github.com/tokio-rs/mio/commit/943d4249dcc17cd8b4d2250c4fa19116097248fa).unix::pipe on illumos (https://github.com/tokio-rs/mio/commit/0db49f6d5caf54b12176821363d154384357e70a).net feature, replaces tcp, udp and uds features (https://github.com/tokio-rs/mio/commit/a301ba520a8479b459c4acdcefa4a7c5eea818c7).os-ext feature, replaces os-util and pipe features (https://github.com/tokio-rs/mio/commit/f5017fae8a3d3bb4b4cada25b01a2d76a406badc).TcpSocket (https://github.com/tokio-rs/mio/commit/290c43a96662d54ab7c4b8814e5a9f9a9e523fda).TcpSocket::set_{send, recv}_buffer_size (https://github.com/tokio-rs/mio/commit/40c4af79bf5b32b8fbdbf6f2e5c16290e1d3d406).TcpSocket::get_linger (https://github.com/tokio-rs/mio/commit/13e82ced655bbb6e2729226e485a7de9f2c2ccd9).IntoRawFd for TcpSocket (https://github.com/tokio-rs/mio/commit/50548ed45d0b2c98f1f2e003e210d14195284ef4).tcp, udp and uds features, replaced by a new net feature. (https://github.com/tokio-rs/mio/commit/a301ba520a8479b459c4acdcefa4a7c5eea818c7).extra-docs feature, now enabled by default. (https://github.com/tokio-rs/mio/commit/25731e8688a2d91c5c700674a2c2d3841240ece1).os-util and pipe features, replaced by a new os-ext feature. (https://github.com/tokio-rs/mio/commit/f5017fae8a3d3bb4b4cada25b01a2d76a406badc).std::net::SocketAddr. Previously Mio would assume that SocketAddrV{4,6} had the same layout as libc::sockaddr_in(6), however this is not guaranteed by the standard library. (https://github.com/tokio-rs/mio/commit/152e0751f0be1c9b0cbd6778645b76bcb0eba93c).TcpSocket::get_localaddr() retrieves local address (https://github.com/tokio-rs/mio/commit/b41a022b2242eef1969c70c8ba93e04c528dba47).TcpSocket::set_reuseport() & TcpSocket::get_reuseport() configures and reads SO_REUSEPORT (https://github.com/tokio-rs/mio/commit/183bbe409ab69cbf9db41d0263b41ec86202d9a0).unix:pipe() a wrapper around pipe(2) sys call (https://github.com/tokio-rs/mio/commit/2b7c0967a7362303946deb3d4ca2ae507af6c72d).Interest:remove() (https://github.com/tokio-rs/mio/commit/b8639c3d9ac07bb7e2e27685680c8a6510fa1357).TcpSocket::set_linger() configures SO_LINGER (https://github.com/tokio-rs/mio/commit/3b4096565c1a879f651b8f8282ecdcbdbd5c92d3).TcpSocket for configuring a TCP socket before connecting or listening (https://github.com/tokio-rs/mio/commit/5b09e60d0f64419b989bda88c86a3147334a03b3).In January 2020 Rust reduced its support for 32-bit Apple targets (https://blog.rust-lang.org/2020/01/03/reducing-support-for-32-bit-apple-targets.html). Starting with v0.7.1 Mio will do the same as we're no longer checking 32 bit iOS/macOS on our CI.
epoll(2)‘s EPOLLERR event as Event::is_write_closed if it’s the only event (https://github.com/tokio-rs/mio/commit/0c77b5712d675eeb9bd43928b5dd7d22b2c7ac0c).SO_NOSIGPIPE on all sockets (not just UDP) on for Apple targets (https://github.com/tokio-rs/mio/commit/b8bbdcb0d3236f4c4acb257996d42a88dc9987d9).POLL_ABORT on Windows (https://github.com/tokio-rs/mio/commit/a98da62b3ed1eeed1770aaca12f46d647e4fa749).SIO_BASE_HANDLE calls on Windows (https://github.com/tokio-rs/mio/commit/b15fc18458a79ef8a51f73effa92548650f4e5dc).accept4(2) (https://github.com/tokio-rs/mio/commit/4e306addc7144f2e02a7e8397c220b179a006a19).lazy_static on Windows (https://github.com/tokio-rs/mio/commit/57e4c2a8ac153bc7bb87829e22cf0a21e3927e8a).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.
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.UnixDatagram, UnixListener and UnixStream.UnixReady was merged into Ready.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.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.Poll and registered event sources. It is recommended to reread the documentation of at least event::Source and Poll.Event was changed to be a wrapper around the OS event. This means it can be significantly larger on some OSs.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.Events was changed to return &Event.Evented was renamed to event::Source and now takes mutable reference to the source.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).accept4(2).fmt::Debug implementation of Events is now actually useful as it prints all Events.= dependency on cfg-if.RDHUP as HUP (#939)Evented for containers (#840).Poll::poll_interruptible (#811)Ready::all and usize conversions (#825)TcpListener::from_std that does not require the socket addr.TcpListener::from_listener in favor of from_std.TcpStream::peek function (#773).Poll: retry select() when interrupted by a signal (#742).Events index access (#713).Events::clear (#782).lio_listio (#780).only_v6 option for UDP sockets|=) are now implemented for Readynet2 crate.O_CLOEXEC with SETFLkeventnet modulePoll is now SyncRegistration now implements Eventedconnect on windows.TcpStream::from_stream which converts a std TCP stream to Mio.TcpStream, allowing vectored reads/writes to work across platformsnix dependencyDisplay and Error for some channel error types.SetFileCompletionNotificationModesEventedFd on Unix)libc to 0.2.16dec logicPollEventLoop and types to deprecated mod. All contents of the deprecated mod will be removed by Mio 1.0.stdstdEvented for any type via RegistrationIoEvent -> EventEvent data via functions vs. public fields.Events as a public type that is passed into Pollstd::time::Duration for all APIs that require a time duration.Events type.std::error::Error for TimerErrorSend bound on notify messages.Clone impl for Timeout (future proof)mio::preludemio::utilEventLoop::register_opt to EventLoop::register (#257)EventLoopConfig is now a builder instead of having public struct fields. It is also no longer Copy. (#259)TcpSocket is no longer exported in the public API (#262)TcpListener now returns the remote peer address from accept as well (#275)UdpSocket::{send_to, recv_from} methods are no longer generic over Buf or MutBuf but instead take slices directly. The return types have also been updated to return the number of bytes transferred. (#260)ready event (#184)