commit | 91a38ded47f038472455e036aaf10fadc48643c5 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Tue Apr 07 14:24:01 2020 -0700 |
committer | Chih-Hung Hsieh <chh@google.com> | Tue Apr 07 14:25:56 2020 -0700 |
tree | 7f1e9eff4140bd6c5e2392610f7fe8f0d14e75f3 | |
parent | 0098f6e975a089a62c156893f8d3951696cb480e [diff] |
Import 'bindgen' package version 0.53.2 * Add OWNERS * No Android.bp yet Bug: 152884384 Test: make Change-Id: I2c8a34b0dc419a19126070a18fc588f7dbeeb099
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