commit | c160b3d1ed7ebd6b5e542fe271a078f4881884cd | [log] [tgz] |
---|---|---|
author | bors-servo <lbergstrom+bors@mozilla.com> | Thu May 25 12:52:27 2017 -0500 |
committer | GitHub <noreply@github.com> | Thu May 25 12:52:27 2017 -0500 |
tree | 4f6ceff50ea208ea664f9514252df50f8c8983b7 | |
parent | 09ac682f296b13aa2694a24a35fd60fa70bd0e45 [diff] | |
parent | e97d041a99d025f2cccd8fcaa2f7d6951b1373e6 [diff] |
Auto merge of #721 - fitzgen:bump-to-0.25.2, r=emilio Bump to version 0.25.2 Need to publish a new version so I can rely on the MacOS mangling fix for my smup branch. r? @emilio
bindgen
bindgen
automatically generates Rust FFI bindings to C and C++ libraries.
For example, given the C header cool.h
:
typedef struct CoolStruct { int x; int y; } CoolStruct; void cool_function(int i, char c, CoolStruct* cs);
bindgen
produces Rust FFI code allowing you to call into the cool
library's functions and use its types:
/* automatically generated by rust-bindgen */ #[repr(C)] pub struct CoolStruct { pub x: ::std::os::raw::c_int, pub y: ::std::os::raw::c_int, } extern "C" { pub fn cool_function(i: ::std::os::raw::c_int, c: ::std::os::raw::c_char, cs: *mut CoolStruct); }
📚 Read the bindgen
users guide here! 📚
API reference documentation is on docs.rs