commit | 5f4dc4f458f0fd14beafbacb8bb20a5a4d139cd5 | [log] [tgz] |
---|---|---|
author | David Vo <auscompgeek@users.noreply.github.com> | Fri Nov 15 00:26:41 2019 +1100 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Thu Nov 14 17:35:38 2019 +0100 |
tree | bb5a46817ed8c7e379a718719440dbc84ca18a65 | |
parent | ac498475e04b44e3c555002213fa9cba0658198e [diff] |
Make rustfmt happy
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