gecko-dev/third_party/rust/bindgen
Servo VCS Sync 0eca03d139 No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
..
.github No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
book No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
ci No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
src No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
.cargo-checksum.json No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
.cargo-ok
.travis.yml No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
CONTRIBUTING.md No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
Cargo.toml No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
LICENSE
README.md No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
appveyor.yml No bug - Revendor rust dependencies 2017-07-28 06:37:28 +00:00
build.rs No bug - Revendor rust dependencies 2017-06-14 23:57:02 +00:00
example-graphviz-ir.png Bug 1341102: Revendor rust dependencies on a CLOSED TREE. r=red 2017-05-08 21:05:42 +02:00
rustfmt.toml

README.md

bindgen

bindgen automatically generates Rust FFI bindings to C and C++ libraries.

For example, given the C header doggo.h:

typedef struct Doggo {
    int many;
    char wow;
} Doggo;

void eleven_out_of_ten_majestic_af(Doggo* pupper);

bindgen produces Rust FFI code allowing you to call into the doggo library's functions and use its types:

/* automatically generated by rust-bindgen */

#[repr(C)]
pub struct Doggo {
    pub many: ::std::os::raw::c_int,
    pub wow: ::std::os::raw::c_char,
}

extern "C" {
    pub fn eleven_out_of_ten_majestic_af(pupper: *mut Doggo);
}

Users Guide

📚 Read the bindgen users guide here! 📚

API Reference

API reference documentation is on docs.rs

Contributing

See CONTRIBUTING.md for hacking on bindgen!