Publish Your Crate! - The bindgen User Guide (original) (raw)
- 1. Introduction
- 2. Requirements
- 3. Library Usage with build.rs
- 4. Command Line Usage
- 5. Customizing the Generated Bindings
- 5.1. Allowlisting
- 5.2. Blocklisting
- 5.3. Treating a Type as an Opaque Blob of Bytes
- 5.4. Replacing One Type with Another
- 5.5. Preventing the Derivation of Copy and Clone
- 5.6. Preventing the Derivation of Debug
- 5.7. Preventing the Derivation of Default
- 5.8. Annotating types with #[must-use]
- 5.9. Field visibility
- 5.10. Code formatting
- 6. Generating Bindings to C++
- 7. Generating Bindings to Objective-c
- 8. Using Unions
- 9. Using Bitfields
- 10. Using Flexible Array Members
- 11. FAQ
The bindgen User Guide
Publish Your Crate!
That's it! Now we can publish our crate on crates.io and we can write a nice, Rust-y API wrapping the raw FFI bindings in a safe interface. However, there is already a bzip2-sys crate providing raw FFI bindings, and there is already a bzip2 crate providing a nice, safe, Rust-y API on top of the bindings, so we have nothing left to do here!
Check out the full code on Github!