mirror of
https://gitee.com/openharmony/third_party_rust_bindgen
synced 2025-03-04 12:47:22 +00:00
Document enum variation precedence
This commit is contained in:
parent
7b99b25129
commit
c8016c1a1f
17
src/lib.rs
17
src/lib.rs
@ -155,6 +155,23 @@ impl Default for CodegenConfig {
|
||||
/// // Write the generated bindings to an output file.
|
||||
/// bindings.write_to_file("path/to/output.rs")?;
|
||||
/// ```
|
||||
///
|
||||
/// # Enums
|
||||
///
|
||||
/// Bindgen can map C/C++ enums into Rust in different ways. The way bindgen maps enums depends on
|
||||
/// the pattern passed to several methods:
|
||||
///
|
||||
/// 1. [`bitfield_enum()`](#method.bitfield_enum)
|
||||
/// 2. [`constified_enum_module()`](#method.constified_enum_module)
|
||||
/// 3. [`rustified_enum()`](#method.rustified_enum)
|
||||
///
|
||||
/// For each C enum, bindgen tries to match the pattern in the following order:
|
||||
///
|
||||
/// 1. Bitfield enum
|
||||
/// 2. Constified enum module
|
||||
/// 3. Rustified enum
|
||||
///
|
||||
/// If none of the above patterns match, then bindgen will generate a set of Rust constants.
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Builder {
|
||||
options: BindgenOptions,
|
||||
|
Loading…
x
Reference in New Issue
Block a user