Chronology of what was authored in the year, 2019
This was presented at the Vancouver Rust programming language meeting of 17 April 2019 and covers a powerful library, where paradoxically one benefits by writing less code overall.
serdeBy Writing Less Rust Code
Two years into using the Rust programming language as a primary language, time arrived for getting back to lower-level work of non-blocking networking calls.
It had been a few years since using
epoll() on Linux or
kqueue()/kpoll() on FreeBSD or (then) MacOSX using C or Common Lisp, specifically SBCL.
While getting my sea-legs with such event loops for network socket TCP/IP streams for writing code for a challenge, here are a few nuggets worth passing along to others. That challenge was to spend less than a day implementing a minimal chat server with the hard constraint of using only one particular networking library beyond the included standard Rust library.
That one library is
mio. Its name means "Metal I/O", but versions before Rust 1.0-stable identified it as "Mini IO".
mio is a thin wrapper around the OS event loop, it's worth noting the underlying behaviour. This applies to
epoll on Linux,
kqueue on BSD Unix and macOS, and
select on other variants of Unix.