timerfd 0.1.0

An implementation of the linux kernel's timerfd interface
Documentation

This crate implements the linux timerfd interface.

Example

use timerfd::{TimerFd, TimerState};
use std::time::Duration;

let mut tfd = TimerFd::new().unwrap();
assert_eq!(tfd.get_state().unwrap(), TimerState::Disarmed);
tfd.set_state(TimerState::Oneshot(Duration::new(1, 0))).unwrap();
match tfd.get_state().unwrap() {
    TimerState::Oneshot(d) => println!("Remaining: {:?}", d),
    _ => unreachable!(),
}
tfd.read().unwrap();
assert_eq!(tfd.get_state().unwrap(), TimerState::Disarmed);