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

#172 in Windows APIs

Download history 1105/week @ 2023-11-24 595/week @ 2023-12-01 975/week @ 2023-12-08 1178/week @ 2023-12-15 865/week @ 2023-12-22 664/week @ 2023-12-29 928/week @ 2024-01-05 1037/week @ 2024-01-12 1031/week @ 2024-01-19 930/week @ 2024-01-26 698/week @ 2024-02-02 1423/week @ 2024-02-09 1538/week @ 2024-02-16 1257/week @ 2024-02-23 1352/week @ 2024-03-01 833/week @ 2024-03-08

5,160 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

~170KB