cbindgen
brew install cbindgen
v0.29.4
MPL-2.0
Project for generating C bindings from Rust code
108
30-day installs · #3358
316
90-day · #3458
850
365-day · #4089
2.9k
★ GitHub stars · updated 2mo ago
Build dependencies
Links
- https://github.com/mozilla/cbindgen
- GitHub: mozilla/cbindgen
- Brew formula source: Formula/c/cbindgen.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [
"rust"
],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Project for generating C bindings from Rust code",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:36:12+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "cbindgen",
"github_default_branch": "main",
"github_last_commit_at": "2026-06-10T21:38:52Z",
"github_readme_excerpt": "# `cbindgen` \u0026emsp; [![Build Status]][actions] [![Latest Version]][crates.io] [![Api Rustdoc]][rustdoc] [](https://github.com/mozilla/cbindgen)\n\n[Build Status]: https://github.com/mozilla/cbindgen/workflows/cbindgen/badge.svg\n[actions]: https://github.com/mozilla/cbindgen/actions\n[Latest Version]: https://img.shields.io/crates/v/cbindgen.svg\n[crates.io]: https://crates.io/crates/cbindgen\n[Api Rustdoc]: https://img.shields.io/badge/api-rustdoc-blue.svg\n[rustdoc]: https://docs.rs/cbindgen\n\n[Read the full user docs here!](https://github.com/mozilla/cbindgen/blob/main/docs.md)\n\ncbindgen creates C/C++11 headers for Rust libraries which expose a public C API.\n\nWhile you could do this by hand, it\u0027s not a particularly good use of your time.\nIt\u0027s also much more likely to be error-prone than machine-generated headers that\nare based on your actual Rust code. The cbindgen developers have also worked\nclosely with the developers of Rust to ensure that the headers we generate\nreflect actual guarantees about Rust\u0027s type layout and ABI.\n\nC++ headers are nice because we can use operator overloads, constructors, enum\nclasses, and templates to make the API more ergonomic and Rust-like. C headers\nare nice because you can be more confident that whoever you\u0027re interoperating\nwith can handle them. With cbindgen *you don\u0027t need to choose*! You can just\ntell it to emit both from the same Rust library.\n\nThere are two ways to use cbindgen: as a standalone program, or as a library\n(presumably in your build.rs). There isn\u0027t really much practical difference,\nbecause cbindgen is a simple rust library with no interesting dependencies.\n\nUsing it as a program means people building your software will need it\ninstalled. Using it in your library means people may have to build cbindgen more\nfrequently (e.g. every time they update their rust compiler).\n\nIt\u0027s worth noting that the development of cbindgen has been largely adhoc, as\nfeatu",
"github_repo": "mozilla/cbindgen",
"github_stars": 2903,
"github_topics": [],
"homepage": "https://github.com/mozilla/cbindgen",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 108,
"installs_365d": 850,
"installs_90d": 316,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "MPL-2.0",
"llm_generated_at": null,
"llm_model": null,
"name": "cbindgen",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 3358,
"rank_365d": 4089,
"rank_90d": 3458,
"raw_hash": "0ec0b3c9316c1385",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/c/cbindgen.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": null,
"version_stable": "0.29.4",
"versioned_formulae": [],
"why_use_this": null
}