tag | 4c76c9ce711e52cb7f65cfb131f55cf22c5a85eb | |
---|---|---|
tagger | Emilio Cobos Álvarez <emilio@crisal.io> | Wed Mar 06 14:17:21 2019 +0100 |
object | 185a5f322e973b60f8d0986672f9a88e5d9a07bd |
v0.48.1
commit | 185a5f322e973b60f8d0986672f9a88e5d9a07bd | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Wed Mar 06 14:16:22 2019 +0100 |
committer | GitHub <noreply@github.com> | Wed Mar 06 14:16:22 2019 +0100 |
tree | 4fa6d49cb0270b3e1c55ef27b74838f2a1569814 | |
parent | 3a6864cf9a76916c002c41a8ae813d9f8bd9853e [diff] | |
parent | 9b6d0e84b432d95b3bfdf5a19b8abadde768489c [diff] |
Merge pull request #1531 from emilio/ref-layout Work around a libclang bug / limitation.
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