kevy-sys
The network-boundary layer for kevy — a tiny, zero-dependency, pure-Rust wrapper over the sockets and readiness poller the kevy server needs.
This is one of kevy's three OS-boundary crates. The other two are publishable, general-purpose crates:
kevy-uring— pure-Rust io_uring (Linux completion engine), carved out of this crate.kevy-madvise— pure-Rustmadvise(MADV_HUGEPAGE)hint, also carved out.
kevy-sys is server-internal — its API surface is hand-curated to the
exact subset of sockets / pollers kevy's reactor uses. A third party
would compare against libc / nix / rustix / mio and find it
missing too much; it's not a generic foundation, it's the OS-boundary
piece of the kevy server.
- Sockets —
tcp_listen/tcp_listen_reuseport, non-blocking I/O,TCP_NODELAY, owned fds that close on drop. - Readiness poller — one API over kqueue (macOS) and epoll (Linux).
- Cross-thread
Waker— a self-pipe to wake a blocked poller. - Cross-platform
sockaddr_in/kevent/epoll_eventlayouts (incl. the x86_64 packedepoll_event).
use ;
let listener = tcp_listen?;
listener.set_nonblocking?;
let poller = new?;
poller.add?;
# Ok::
Safety
unsafe is confined to the ffi module and its wrappers; the public API
is safe. See the crate docs' Safety section for the ABI invariants.
License
Licensed under either of MIT or Apache-2.0 at your option.