tag | 3072d417dfd7a1c2cc353638b55b2e44e2c34da9 | |
---|---|---|
tagger | Emilio Cobos Álvarez <emilio@crisal.io> | Tue Nov 19 20:30:29 2019 +0100 |
object | b44be6e3dbce03857c6eac221b1350acd68cb357 |
v0.52.0
commit | b44be6e3dbce03857c6eac221b1350acd68cb357 | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Tue Nov 19 16:59:38 2019 +0100 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Tue Nov 19 16:59:38 2019 +0100 |
tree | 006fa90c7167375e3205e1f11fcad3533d02c708 | |
parent | 5f4dc4f458f0fd14beafbacb8bb20a5a4d139cd5 [diff] |
v0.52.0
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