Design and introduction to epoll 69 } pub fn registry(&self)-> &Registry { &self. registry } pub fn poll(&mut self, events: &mut Events, timeout: Option<i32>)-> Result<()> { todo!() } } pub struct Registry { raw_fd: i32, } impl Registry { pub fn register(&self, source: &Tcp Stream, token: usize, interests: i32)-> Result<()> { todo!() } } impl Drop for Registry { fn drop(&mut self) { todo!() } } We've replaced all the implementations with todo!() for now. This macro will let us compile the program even though we've yet to implement the function body. If our execution ever reaches todo!(), it will panic. The first thing you'll notice is that we'll pull the ffi module in scope in addition to some types from the standard library. We'll also use the std::io::Result type as our own Result type. It's convenient since most errors will stem from one of our calls into the operating system, and an operating system error can be mapped to an io::Error type. There are two main abstractions over epoll. One is a structure called Poll and the other is called Registry. The name and functionality of these functions are the same as they are in mio. Naming abstractions such as these is surprisingly difficult, and both constructs could very well have had a different name, but let's lean on the fact that someone else has spent time on this before us and decided to go with these in our example.