#wepoll #poll #windows #epoll

sys wepoll-sys

Raw bindings to the wepoll library

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

#37 in Windows APIs

Download history 587/week @ 2020-07-07 606/week @ 2020-07-14 598/week @ 2020-07-21 983/week @ 2020-07-28 977/week @ 2020-08-04 673/week @ 2020-08-11 738/week @ 2020-08-18 1027/week @ 2020-08-25 980/week @ 2020-09-01 1070/week @ 2020-09-08 735/week @ 2020-09-15 523/week @ 2020-09-22 2712/week @ 2020-09-29 7529/week @ 2020-10-06 8641/week @ 2020-10-13 8980/week @ 2020-10-20

9,209 downloads per month
Used in 673 crates (2 directly)

MPL-2.0 license

77KB
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

~130KB