commit | 37fa476a277ddee64675d8ceb682377105d2f8f0 | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Fri Jul 26 17:39:41 2019 +0200 |
committer | GitHub <noreply@github.com> | Fri Jul 26 17:39:41 2019 +0200 |
tree | e2111c6666a3017052869a96fe93b93dfeb0a781 | |
parent | a3d8cf75f85fda70d36f2c74d2ecd0b414a63736 [diff] | |
parent | 0891848b09197d624ae3fb6f8938d833c926b5f0 [diff] |
Allow to override rustfmt path with an environment variable. (#1602) Also fix rustfmt installation to be via rustup, since rustfmt-nightly doesn't compile in nightly rust. Fixes #1601
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