rust-bindgen

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

  • Owner: rust-lang/rust-bindgen
  • Platform:
  • License:: BSD 3-Clause "New" or "Revised" License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

crates.io
docs.rs

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);
}

Users Guide

? Read the bindgen users guide here! ?

API Reference

API reference documentation is on docs.rs

Contributing

See CONTRIBUTING.md for hacking on bindgen!

Main metrics

Overview
Name With Ownerrust-lang/rust-bindgen
Primary LanguageRust
Program languageRust (Language Count: 7)
Platform
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2016-06-22 15:05:51
Pushed At2025-06-08 22:54:31
Last Commit At
Release Count126
Last Release Namev0.72.0 (Posted on 2025-06-08 13:15:48)
First Release Name0.5 (Posted on )
用户参与
Stargazers Count4.8k
Watchers Count57
Fork Count748
Commits Count3.8k
Has Issues Enabled
Issues Count1564
Issue Open Count474
Pull Requests Count1388
Pull Requests Open Count50
Pull Requests Close Count176
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private