tag | 3563b7427b536cae4e757e468b30d736098aa7cb | |
---|---|---|
tagger | Emilio Cobos Álvarez <emilio@crisal.io> | Thu Oct 11 18:18:36 2018 +0200 |
object | 6055f364bd1d341da8fa881741ec36ab0abf0a7a |
v0.42.2
commit | 6055f364bd1d341da8fa881741ec36ab0abf0a7a | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Thu Oct 11 18:00:29 2018 +0200 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Thu Oct 11 18:17:09 2018 +0200 |
tree | 1c931e49d9fd88a11a662d86799e6be7a67c9f86 | |
parent | c137196c9f4411456284e2205db314a4ae700f9f [diff] |
Minor cleanup after #1419. The previous PR ended up with a lot of just-called-once methods. Just inline them since they're confusing otherwise. Also avoid testing all the variants of an enum if there was a match already, or if the enum is not anonymous. This is mostly a minor optimization.
bindgen
impl period
has been started! Join us at Gitter.im.
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