#libevent #bindings #async #io

libevent

Rust bindings to the libevent async I/O framework

2 unstable releases

0.1.0 Aug 19, 2020
0.0.0 May 1, 2020

#180 in Asynchronous

Download history 932/week @ 2020-10-31 1023/week @ 2020-11-07 976/week @ 2020-11-14 696/week @ 2020-11-21 569/week @ 2020-11-28 1134/week @ 2020-12-05 873/week @ 2020-12-12 657/week @ 2020-12-19 972/week @ 2020-12-26 974/week @ 2021-01-02 880/week @ 2021-01-09 651/week @ 2021-01-16 843/week @ 2021-01-23 1102/week @ 2021-01-30 1287/week @ 2021-02-06 1214/week @ 2021-02-13

749 downloads per month

MIT/Apache

2MB
53K SLoC

C 49K SLoC // 0.1% comments Python 1.5K SLoC // 0.1% comments Rust 764 SLoC // 0.0% comments Shell 527 SLoC // 0.1% comments Automake 446 SLoC // 0.2% comments

libevent-rs

Released API docs

Rust bindings to the libevent async I/O framework.

Example

use libevent::{Base, Interval};

let mut base = Base::new();

let mut count: usize = 0;

let timer = Interval::new(Duration::from_secs(1));

base.spawn(timer, move |_event| {
    count += 1;
    println!("count: {}", count);
})?;

base.run();

System Requirements

  • libclang is required by bindgen which is used to generate the Rust bindings. See bindgen requirements for more information. Also ensure that LIBCLANG_PATH is set, as some systems do not do so by default. libclang is only required if buildtime_bindgen is enabled.

  • cmake if self-building via the bundled feature. The current bundled release is release-2.1.11-stable.

  • pkg-config if not self-building via the bundled feature.

  • buildtime_bindgen is an optional feature, enabled by default, which indicates that the Rust libevent bindings should be generated at build time.

  • LIBEVENT_SYS_BINDGEN_FILE is an environment variable indicating the path of the file containing the pregenerated Rust bindings which must be populated when buildtime_bindgen is not enabled, and it is only applicable in this case.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies