commit | 3c10d7d61c9393db75dffa45aaee9f7b5a93a3c1 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Sun Jul 12 14:12:43 2020 -0700 |
committer | Chih-Hung Hsieh <chh@google.com> | Mon Jul 13 16:19:17 2020 -0700 |
tree | e1f92e05b71ea59c309e35874fdcee8b954f85a0 | |
parent | f7a245b6d54bacfe21e92fa2f120220b7a277929 [diff] |
Regenerate Android.bp with new cargo2android.py Test: make Change-Id: Ie91399eaa104d71abbdbb28e4494aab83c478f1a
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! 📚
The minimum supported Rust version is 1.34.
No MSRV bump policy has been established yet, so MSRV may increase in any release.
API reference documentation is on docs.rs