pollio 0.1.1

A small native event poller abstraction over epoll and kqueue
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::EventObject;
use std::io;
use std::os::fd::RawFd;

pub trait Poller {
    fn new() -> io::Result<Self>
    where
        Self: Sized;

    fn add(&self, event: EventObject) -> io::Result<()>;

    fn delete(&self, fd: RawFd) -> io::Result<()>;

    fn wait(&mut self, timeout_ms: i32) -> io::Result<Vec<EventObject>>;
}