commit | 1104631a142620ed69c31e6af681b0bc707194a4 | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Sat Dec 29 14:48:48 2018 +0100 |
committer | GitHub <noreply@github.com> | Sat Dec 29 14:48:48 2018 +0100 |
tree | 0effeb6e37ec1c456ab980e2193ebb47a1fd3a77 | |
parent | f2ac19c7543d5f44ec38a194126ae1d9b498c90d [diff] | |
parent | 2c8bf0b1b90b513967fd4f49a9b80dd37fbd4b29 [diff] |
Merge pull request #1473 from emilio/hash Some perf tweaks
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