ruyi 0.1.6

An event-driven framework for non-blocking, asynchronous I/O in Rust
Documentation
use std::time::Duration;

fn into_millis(dur: Duration) -> u64 {
    const NANOS_PER_MILLI: u32 = 1_000_000;
    const MILLIS_PER_SEC: u64 = 1_000;

    let millis = (dur.subsec_nanos() + NANOS_PER_MILLI - 1) / NANOS_PER_MILLI;
    dur.as_secs()
        .wrapping_mul(MILLIS_PER_SEC)
        .wrapping_add(millis as u64)
}

#[cfg(unix)]
mod unix;

#[cfg(unix)]
pub use self::unix::{Event, IoVec, Awakener, Selector, OP_READ, OP_WRITE};
pub use self::unix::tcp::{accept, connect, new_v4, new_v6, readv, writev};

#[cfg(windows)]
mod windows;

#[cfg(windows)]
pub use self::windows::*;