Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 01-Sep-2019 | - | ||||
src/ | H | 01-Sep-2019 | - | 25,643 | 18,425 | |
.cargo-checksum.json | H A D | 01-Sep-2019 | 4.8 KiB | 1 | 1 | |
Cargo.toml | H A D | 01-Sep-2019 | 2.3 KiB | 96 | 78 | |
LICENSE | H A D | 01-Sep-2019 | 1.4 KiB | 29 | 24 | |
README.md | H A D | 01-Sep-2019 | 1.1 KiB | 46 | 30 | |
build.rs | H A D | 01-Sep-2019 | 2 KiB | 74 | 61 |
README.md
1# `bindgen` 2 3[`impl period`](https://blog.rust-lang.org/2017/09/18/impl-future-for-rust.html) has been started! Join us at [Gitter.im](https://gitter.im/rust-impl-period/WG-dev-tools-bindgen). 4 5**`bindgen` automatically generates Rust FFI bindings to C (and some C++) libraries.** 6 7For example, given the C header `doggo.h`: 8 9```c 10typedef struct Doggo { 11 int many; 12 char wow; 13} Doggo; 14 15void eleven_out_of_ten_majestic_af(Doggo* pupper); 16``` 17 18`bindgen` produces Rust FFI code allowing you to call into the `doggo` library's 19functions and use its types: 20 21```rust 22/* automatically generated by rust-bindgen */ 23 24#[repr(C)] 25pub struct Doggo { 26 pub many: ::std::os::raw::c_int, 27 pub wow: ::std::os::raw::c_char, 28} 29 30extern "C" { 31 pub fn eleven_out_of_ten_majestic_af(pupper: *mut Doggo); 32} 33``` 34 35## Users Guide 36 37[ Read the `bindgen` users guide here! ](https://rust-lang-nursery.github.io/rust-bindgen) 38 39## API Reference 40 41[API reference documentation is on docs.rs](https://docs.rs/bindgen) 42 43## Contributing 44 45[See `CONTRIBUTING.md` for hacking on `bindgen`!](./CONTRIBUTING.md) 46