# rust-lang/rust-bindgen

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

Repository: https://github.com/rust-lang/rust-bindgen
Canonical: https://ross.abutalabs.com/products/rust-bindgen
Homepage: https://rust-lang.github.io/rust-bindgen/
Language: Rust
License: BSD-3-Clause
License Family: permissive
Topics: ffi, bindings, codegen
Last push: 2026-08-21T16:10:35+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 33, longevity 100
- inputs: {"age_days": 3724, "days_push": 12, "days_rel": 367, "gap_med": 72.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5270, forks 828 (observed 2026-08-28T04:09:13.973954+00:00)

## What it is
bindgen is a Rust tool that automatically generates Rust FFI bindings to C (and some C++) libraries by parsing header files with libclang. It is available both as a CLI executable and as a library crate for build scripts.

## Use cases
- generate Rust bindings for a C library
- call C functions from Rust
- wrap a C++ library for use in Rust
- convert C header files to Rust declarations
- set up FFI for a native dependency in a Cargo build

## When to choose
- you need to call a C or C library from Rust without hand-writing extern declarations
- you want bindings kept in sync with upstream C headers
- you are building a -sys crate for a native library

## When to avoid
- the C++ library uses complex templates or advanced features bindgen cannot translate
- you need bindings for languages other than C/C++
- you want a hand-tuned, idiomatic safe Rust API rather than raw FFI declarations

## Facets
- artifact type: cli-tool
- maturity: active
- function: parser, developer-tools, cli
- domain: developer-tools, programming-languages, parsers
- platform: rust, cross-platform, cli
- tags: ffi, bindings, c-interop, cpp-interop, libclang, rust, codegen

## Member repositories
- rust-lang/rust-bindgen (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:13.973954+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:59:28.487548+00:00, confidence not recorded.
  - readme: https://github.com/rust-lang/rust-bindgen (fetched 2026-08-28T04:09:13.973954+00:00, sha f04c7d81be22)
  - homepage: https://rust-lang.github.io/rust-bindgen/ (fetched 2026-08-29T08:54:14.292154+00:00, sha 57c94154e271)
- Data as of 2026-08-30T08:39:29.467469+00:00.
