commit | ac498475e04b44e3c555002213fa9cba0658198e | [log] [tgz] |
---|---|---|
author | David Vo <auscompgeek@users.noreply.github.com> | Thu Nov 14 22:55:05 2019 +1100 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Thu Nov 14 17:35:38 2019 +0100 |
tree | 748c5addf3c70199cfae791e8741708707620f3d | |
parent | f27fe97089b5c124dae4afbbbfeb66a3b44579d5 [diff] |
Add newtype enum style This adds an enum style similar to the existing bitfield style, without the bitwise operator impls. Closes: #1669
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