tag | b8f0515a8f5c964b21b0186b84d013d59c249df8 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Fri Jun 19 16:31:12 2020 -0700 |
object | dd730bab9a86b174a4facfe435afc1eb454d93bf |
Platform Tools Release 30.0.3 (6597393)
commit | dd730bab9a86b174a4facfe435afc1eb454d93bf | [log] [tgz] |
---|---|---|
author | android-build-prod (mdb) <android-build-team-robot@google.com> | Wed May 27 20:49:16 2020 +0000 |
committer | android-build-prod (mdb) <android-build-team-robot@google.com> | Wed May 27 20:49:16 2020 +0000 |
tree | 45b69894d3a1e7c6fadbceb06634ab6ab56ba0c7 | |
parent | bc13443e65773d7de057f9d3c9f3cb52f917f098 [diff] | |
parent | dbbffdc2302668a4bab17c83319d00ea779d5ce7 [diff] |
Snap for 6533464 from dbbffdc2302668a4bab17c83319d00ea779d5ce7 to sdk-release Change-Id: I3078581b1f62a04be23c47207f5f6182affccc14
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