bindgen

Automatically generates Rust FFI bindings to C and C++ libraries

brewmacoslinux
Try with needOr install directly
Source

About

Automatically generates Rust FFI bindings to C (and some C++) libraries

Commands

bindgen

Examples

Generate Rust bindings from a C header file$ bindgen mylib.h -o bindings.rs
Generate bindings with custom configuration using a wrapper header$ bindgen --use-core wrapper.h -o src/ffi.rs
Generate bindings with specific allowlist to reduce output size$ bindgen mylib.h --allowlist-function 'my_.*' --allowlist-type 'MyType' -o bindings.rs