Skip to content

Allow for renaming struct/union fields#3358

Open
wolfd wants to merge 1 commit intorust-lang:mainfrom
wolfd:rename-fields
Open

Allow for renaming struct/union fields#3358
wolfd wants to merge 1 commit intorust-lang:mainfrom
wolfd:rename-fields

Conversation

@wolfd
Copy link
Copy Markdown

@wolfd wolfd commented Apr 3, 2026

I've added a ParseCallbacks method called field_name which is given the same FieldInfo struct that field_visibility takes.

I wasn't entirely sure where to change field names, I ended up doing it in what was deanonymize_fields which has been renamed to assign_field_names as suggested by this comment.

Related to #1097 and #1098

I've added a `ParseCallbacks` method called `field_name` which is given
the same `FieldInfo` struct that `field_visibility` takes.

I wasn't entirely sure where to change field names, I ended up doing it
in what was `deanonymize_fields` which has been renamed to
`assign_field_names` as suggested by [this
comment](rust-lang#1058 (comment))

Related to rust-lang#1097 and rust-lang#1098
wolfd added a commit to AutoPallet/orbbec-sdk-rs that referenced this pull request Apr 3, 2026
This is a pretty big (breaking!) change.
- Update OrbbecSDK submodule, vendor in crate
- Rework binding generation to change how properties work.
- Add macros for common patterns of calling orbbec sdk functions.

I've also collapsed the other PRs on this repo into this one, with
separate commits for each.

The first commit updates the OrbbecSDK submodule, and changes the build
process to vendor the contents of the OrbbecSDK folder into the crate.

Caveat: OrbbecSDK writes out a couple files to its source directory, so
we need to copy the whole source directory to OUT_DIR before building.

The next commit reworks the binding generation to use Rust-y enums
instead of raw integers. In many cases, we're now using the rust enums
directly in the public API. This isn't complete, since I would like to
rename struct members too (see rust-lang/rust-bindgen#3358).

The third commit adds macros for common patterns of calling the C SDK
functions, and rewrites all of the current calls to the C SDK to use
them.

I think my vision is to further reduce the sys/ layer so that src/ does
most of the work.

The rest of the commits are adding various features to the public API.

Topic: vendor-submodule
@wolfd
Copy link
Copy Markdown
Author

wolfd commented Apr 6, 2026

r? @emilio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants