tokio-rs/mio
65.6
Adequate · 14 November 2026
12.2k
lines of production code
Rust
primary language
5
measurements over time
What this system is
Features
Add Unix Domain Socket (UDS) support for Unix systems
This change introduces the \sys::unix::uds\ module, providing the underlying system-level implementation for Unix Domain Sockets. It adds support for \UnixStream\, \UnixListener\, and \UnixDatagram\ across a wide range of Unix-like operating systems, including Linux, macOS, FreeBSD, Android, and several embedded or niche targets (e.g., ESP-IDF, Haiku, AIX). The implementation handles platform-specific nuances such as abstract namespaces on Linux/Android, fallback to \accept()\ on platforms lacking \accept4()\, and consistent file descriptor handling (CLOEXEC, non-blocking) to ensure robustness and portability.
src/sys/unix/uds · high confidence
Add Unix domain socket support for Unix systems
This change introduces new \UnixStream\, \UnixListener\, and \UnixDatagram\ types in the \src/net/uds\ module, enabling non-blocking I/O on Unix domain sockets. These types wrap the standard library's \std::os::unix::net\ equivalents using an internal \IoSource\ helper to manage event registration and \WouldBlock\ handling via the \try\_io\ method. The implementation provides standard socket operations such as binding, connecting, accepting, sending, and receiving data, along with conversions to and from standard library types and file descriptor traits.
src/net/uds · high confidence
Added shell system backend as a placeholder for unsupported targets
A new \sys::shell\ module has been introduced to serve as a stub implementation for operating systems or configurations that do not support the primary polling and networking backends. This module provides no-op implementations for the selector, waker, TCP, UDP, and Unix domain socket subsystems; all public methods panic at runtime with a message instructing the user to compile with the \os-poll\ feature. This ensures that builds on unsupported targets fail fast with a clear error rather than exhibiting undefined behavior or linking errors.
src/sys/shell · high confidence
New TCP and UDP server examples for network programming
Added three new example programs in the \examples\ directory to demonstrate network I/O patterns: \tcp\_server.rs\ (a standard TCP echo server binding to 127.0.0.1:9000), \tcp\_listenfd\_server.rs\ (a TCP server that accepts a pre-opened file descriptor via the \LISTEN\_FDS\ environment variable, supporting WASI and HermitOS), and \udp\_server.rs\ (a UDP echo server). These examples illustrate how to use \mio::Poll\, \TcpListener\, \TcpStream\, and \UdpSocket\ with non-blocking I/O, event registration, and proper handling of \WouldBlock\ and \Interrupted\ errors.
examples · high confidence
Architecture
Reorganize system-specific code into a dedicated sys module
The library now isolates platform-dependent implementations (Unix, Windows, WASI, and a shell fallback) within a new \src/sys\ module. This structural change consolidates system-specific types like \Selector\, \Event\, and \IoSource\ into a single location, simplifying the public API surface and making it easier to maintain or extend support for different operating systems.
src/sys · high confidence
Reorganized networking types into the \`mio::net\` module
The networking primitives (TcpListener, TcpStream, UdpSocket, and Unix domain sockets) have been moved into a dedicated \src/net\ module. This change restructures the public API surface, grouping these types under \mio::net\ for better organization and clarity, while maintaining their existing functionality and non-blocking behavior.
src/net · high confidence
Behavioural changes
Mio v1.0: Complete API redesign with feature-gated modules
This release introduces a breaking API redesign for Mio, replacing the legacy \Reactor\ and \Handler\ traits with a modern, non-blocking \Poll\ and \Registry\ system. The old event-driven callback model is removed in favor of explicit readiness polling and an \Interest\ bitmask for registering sources. The crate is now structured around feature flags (\os-poll\, \os-ext\, \net\) to allow minimal builds, and introduces new core types like \Token\, \Waker\, and \IoSource\ to manage event sources and cross-thread notifications. Platform-specific code is consolidated into \sys\ modules, and the public API is reorganized into distinct \event\, \net\, and platform-specific (\unix\, \windows\, \wasi\) modules.
src · high confidence
New event readiness detection methods and Source trait reorganization
The event module now exposes \is\_read\_closed\ and \is\_write\_closed\ methods on \Event\, allowing users to detect when the read or write half of a socket has been closed by the peer or local stream. The \Event\ struct is now \Clone\, and its iterator returns references to events rather than owned copies. The \Evented\ trait has been renamed to \event::Source\, and its registration methods (\register\, \reregister\, \deregister\) now take a mutable reference to the source instead of an immutable one, requiring callers to update their implementations accordingly.
src/event · high confidence
Refactor TCP networking types to use IoSource
The \TcpListener\ and \TcpStream\ types in \src/net/tcp\ have been restructured to wrap the standard library's \net::TcpListener\ and \net::TcpStream\ inside a new \IoSource\ adapter. This change centralizes I/O safety and event registration logic, allowing the TCP types to implement traits like \AsFd\ and \IntoRawFd\ more consistently across Unix, Windows, and HermitOS. For users, the public API surface remains largely compatible, but the underlying implementation now relies on \IoSource\ for handling raw file descriptor/socket conversions and non-blocking I/O operations.
src/net/tcp · high confidence
Refactor selector backends to use OwnedFd and split IoSourceState by statefulness
The Unix selector implementations (epoll, kqueue, event\_ports, and poll) now manage file descriptors using std::os::fd::OwnedFd instead of raw integers, ensuring automatic cleanup and preventing leaks. To support backends that require user-space bookkeeping (poll and event\_ports), the codebase introduces a stateful IoSourceState implementation that tracks registration records and handles internal deregistration on closed fds, while stateless backends (epoll and kqueue) use a lightweight pass-through IoSourceState.
src/sys/unix/selector · high confidence
Refactored Unix waker implementations into dedicated modules
The Unix waker logic has been reorganized into separate, platform-specific modules (eventfd, pipe, selector, and single\_threaded) within the sys::unix::waker directory. This change extracts the underlying mechanisms for waking I/O selectors—such as using eventfd counters, Unix pipes, or selector-specific wake calls—into distinct files, improving code maintainability and clarity for each operating system's requirements without altering the external API.
src/sys/unix/waker · high confidence
Rewritten Windows I/O implementation using windows-sys
The Windows system backend has been completely rewritten to replace the legacy winapi/miow dependencies with the windows-sys crate. This change introduces a new internal architecture for handling asynchronous I/O, including a dedicated AFD (Ancillary Functions for Winsock) driver interface for polling, a refined I/O Completion Port (IOCP) wrapper, and a new readiness-based event model that bridges the gap between completion-based IOCP and readiness-based selectors. Users benefit from improved stability, better error handling for named pipes and TCP/UDP sockets, and a more robust foundation for cross-platform compatibility.
src/sys/windows · high confidence
Unix platform support consolidated into sys::unix module
The internal Unix implementation has been reorganized into a dedicated \src/sys/unix\ module, centralizing platform-specific logic for socket creation, TCP/UDP operations, and pipe handling. This change introduces a unified \syscall!\ macro for error handling, standardizes non-blocking socket setup across diverse OS families (including Apple, BSD, Linux, and AIX), and adds support for new Unix-like targets such as ESP-IDF, NuttX, and Vita. It also exposes the \SourceFd\ adapter for registering arbitrary file descriptors and implements a cross-platform \pipe\ module for inter-process communication, while ensuring consistent behavior for socket options like \SO\_NOSIGPIPE\ and \O\_NONBLOCK\.
src/sys/unix · high confidence
Test coverage
Comprehensive test suite for I/O sources and polling behavior; New test utilities for event readiness and polling assertions.
Dependencies
Mio 1.2.3: Upgrade to Rust 2021 Edition and windows-sys 0.61
This release updates the project to the Rust 2021 edition and raises the minimum supported Rust version (MSRV) to 1.71. It upgrades the Windows dependency from windows-sys 0.60 to 0.61 and the Unix dependency libc to 0.2.183. The package also removes the nix dependency, adds wasi 0.11.0 for WASI targets, and updates dev-dependencies including env\_logger to 0.11 and rand to 0.9.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 64 → 66 (+1.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 96 → 93 (-2.7)
- Architecture 86 → 98 (+11.7)
- Maturity 53 → 53 (+0.4)
- Readiness 74 → 69 (-5.1)
- Security 68 → 75 (+7.5)
Resolved (14)
- Change coupling: stream.rs ↔ udp.rs (src/net/tcp/stream.rs)
- Duplicated block (11–15 lines × 2) (src/sys/unix/selector/event_ports.rs)
- Duplicated block (14 lines × 2) (src/sys/windows/named_pipe.rs)
- Duplicated block (8 lines × 2) (src/sys/unix/selector/epoll.rs)
- Duplicated block (8 lines × 3) (src/sys/unix/selector/event_ports.rs)
- High: security finding (details withheld)
- Inverted test pyramid
- Off-boarding risk: anonymized user #1
- Orphaned file (src/sys/windows/iocp.rs)
- Projects may be oversized for their cohesion
- Rotate the exposed credentials — git history can't be un-committed
- Secret: aws-access-token (.travis.yml)
- Secret: aws-access-token (.travis.yml)
- Secret: aws-access-token (.travis.yml)
New (26)
- AWS access key ID with no secret key beside it (.travis.yml)
- AWS access key ID with no secret key beside it (.travis.yml)
- AWS access key ID with no secret key beside it (.travis.yml)
- Duplicated block (11–15 lines × 2) (src/sys/unix/selector/event_ports.rs)
- Duplicated block (5 lines × 2) (src/sys/windows/named_pipe.rs)
- Duplicated block (8 lines × 3) (src/sys/unix/selector/event_ports.rs)
- Edited copy of a member (10 corresponding lines) (src/sys/unix/waker/eventfd.rs)
- Edited copy of a member (12 corresponding lines) (src/sys/windows/named_pipe.rs)
- Edited copy of a member (13 corresponding lines) (src/io_source.rs)
- Edited copy of a member (13 corresponding lines) (src/sys/unix/selector/event_ports.rs)
- Edited copy of a member (17 corresponding lines) (src/sys/windows/named_pipe.rs)
- Edited copy of a member (26 corresponding lines) (src/sys/unix/selector/kqueue.rs)
- Edited copy of a member (5 corresponding lines) (src/sys/unix/tcp.rs)
- Edited copy of a member (8 corresponding lines) (src/sys/unix/selector/epoll.rs)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Low coverage: src/event/event.rs (src/event/event.rs)
- Low coverage: src/event/events.rs (src/event/events.rs)
- Low coverage: src/event/source.rs (src/event/source.rs)
- Low coverage: src/poll.rs (src/poll.rs)
- …and 6 more
Changes since last survey
- 4 commits — 4 feature/other, 0 fixes
By area
- .github/workflows — 2 commits
- (root) — 1 commit
- src/sys — 1 commit
Notable commits
- change: Give every named pipe operation its own OVERLAPPED (#2028)
- change: Lock Node.js 22 in CI for Emscripten
- change: Release v1.2.5
- change: use RUSTFLAGS=-Cpanic=unwind for WASI tests
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
tokio-rs/mio was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 101e5b7c92b1b5f8abc0ba3eb81b264943e13e37 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.