Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: custom derives #2024

Closed
tbodt opened this issue Apr 5, 2021 · 1 comment
Closed

Feature request: custom derives #2024

tbodt opened this issue Apr 5, 2021 · 1 comment

Comments

@tbodt
Copy link
Contributor

tbodt commented Apr 5, 2021

I want to be able to add custom traits to the #[derive( on Bindgen types. My specific use case is the FromBytes derive from https://docs.rs/zerocopy. This might look something like this:

bindgen::Builder::default()
    .header("input.h")
    .raw_line("use zerocopy::FromBytes;")
    .derive_custom("FromBytes")
    .generate()
    .unwrap()
@emilio
Copy link
Contributor

emilio commented Apr 6, 2021

Dupe of #1089, probably should be keyed per-type? If so this should be reasonably straight-forward. If not, we might need more information to know when something can be derived or not...

@emilio emilio closed this as completed Apr 6, 2021
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

No branches or pull requests

2 participants