9 stable releases

3.0.1 Oct 20, 2020
3.0.0 Oct 2, 2020
2.0.0 Apr 26, 2020
1.1.0 Apr 25, 2020
1.0.3 Apr 6, 2019

#180 in Windows APIs

Download history 1185/week @ 2024-03-13 1580/week @ 2024-03-20 1595/week @ 2024-03-27 1530/week @ 2024-04-03 1206/week @ 2024-04-10 1379/week @ 2024-04-17 1443/week @ 2024-04-24 1220/week @ 2024-05-01 1130/week @ 2024-05-08 1297/week @ 2024-05-15 1411/week @ 2024-05-22 1252/week @ 2024-05-29 1270/week @ 2024-06-05 968/week @ 2024-06-12 1138/week @ 2024-06-19 1110/week @ 2024-06-26

4,697 downloads per month
Used in wepoll-binding

MPL-2.0 license

78KB
2K SLoC

C 1.5K SLoC // 0.1% comments Rust 131 SLoC

wepoll-sys

wepoll-sys provides unsafe Rust bindings to wepoll. The wepoll library is included in this crate and compiled automatically, removing the need for manually installing it.

Requirements

  • Rust 2018
  • Windows
  • clang
  • A compiler such as gcc, the MSVC compiler (cl.exe), etc

Usage

Add wepoll-sys as a Windows dependency (since it won't build on other platforms):

[dependencies.'cfg(windows)'.dependencies]
wepoll-sys = "2.0"

Since this crate just provides a generated wrapper around the wepoll library, usage is the same as with the C code. For example:

use wepoll_sys;

fn main() {
    let wepoll = wepoll_sys::epoll_create(1);

    if wepoll.is_null() {
        panic!("epoll_create(1) failed!");
    }

    // ...
}

lib.rs:

A unsafe/raw wrapper around wepoll.

The bindings in this crate were originally generated using bindgen, then cleaned up by hand. They are maintained manually to reduce the amount of dependencies and build-time complexity. As wepoll's public API rarely changes, this should not pose any problems.

Dependencies

~180KB