tag | e36d3c002bf8641a301e5bb21557ad4684cba73d | |
---|---|---|
tagger | Emilio Cobos Álvarez <emilio@crisal.io> | Wed Dec 04 17:01:41 2019 +0100 |
object | 15d9cb242d91ae736a3d048e456c12528c886404 |
v0.49.4
commit | 15d9cb242d91ae736a3d048e456c12528c886404 | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Wed Dec 04 17:01:29 2019 +0100 |
committer | Emilio Cobos Álvarez <emilio@crisal.io> | Wed Dec 04 17:01:29 2019 +0100 |
tree | c6ac105d3c1524ccb1a83dca310d599625c090b4 | |
parent | c8f477dc29397766f8b879284e142bad4a62d803 [diff] |
v0.49.4
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