tag | d33f8059d9ab01a2efc5f1cfa9187f513e549211 | |
---|---|---|
tagger | Emilio Cobos Álvarez <emilio@crisal.io> | Fri Dec 14 13:44:40 2018 +0100 |
object | 371e744e4158f23e75adb296433fc684076964ad |
v0.45.0
commit | 371e744e4158f23e75adb296433fc684076964ad | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Fri Dec 14 13:43:51 2018 +0100 |
committer | GitHub <noreply@github.com> | Fri Dec 14 13:43:51 2018 +0100 |
tree | 9b3bbf2fff95cf96b170420a7346f0775806ca00 | |
parent | eb97c1494d5debac81b51847c3cba61496471bfb [diff] | |
parent | 9ba6d13c4320bd7d225b086957c801811458f2c7 [diff] |
Merge pull request #1467 from emilio/attr-detection-flag ir: Put function attribute detection under an opt-in flag.
bindgen
bindgen
automatically generates Rust FFI bindings to C (and some 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); }
📚 Read the bindgen
users guide here! 📚
API reference documentation is on docs.rs