Supporting unstable libraries via bitflags_derive #435

Open
opened 2025-02-05 04:26:40 -06:00 by KodrAus · 0 comments
KodrAus commented 2025-02-05 04:26:40 -06:00 (Migrated from github.com)

I've just published an initial sketch of a library called bitflags-derive that takes advantage of the Flags trait to support flags-aware custom derives. This should be a good way for us to add support for external libraries in your bitflags! invocations going forwards.

So far I've just added support for deriving Debug to get a bit of infrastructure in place, but would love to add support for other libraries there too, like binrw for example, which we couldn't add due to it being unstable in #370. If there are any you would find particularly useful, please feel free to raise an issue over in bitflags-derive and/or PR support for it. We'll use optional features in bitflags-derive to toggle other libraries on and off.

I've just published an initial sketch of a library [called `bitflags-derive`](https://github.com/bitflags/bitflags-derive) that takes advantage of the [`Flags`](https://docs.rs/bitflags/latest/bitflags/trait.Flags.html) trait to support flags-aware custom derives. This should be a good way for us to add support for external libraries in your `bitflags!` invocations going forwards. So far I've just added support for deriving `Debug` to get a bit of infrastructure in place, but would love to add support for other libraries there too, like `binrw` for example, which we couldn't add due to it being unstable in #370. If there are any you would find particularly useful, please feel free to [raise an issue over in bitflags-derive](https://github.com/bitflags/bitflags-derive/issues) and/or PR support for it. We'll use optional features in `bitflags-derive` to toggle other libraries on and off.
Sign in to join this conversation.
No labels
bug
good first issue
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-bitflags/bitflags#435
No description provided.