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

Implement bitflags!-like traits for NS_OPTIONS enums #602

Closed
madsmtm opened this issue Apr 17, 2024 · 1 comment
Closed

Implement bitflags!-like traits for NS_OPTIONS enums #602

madsmtm opened this issue Apr 17, 2024 · 1 comment
Labels
A-framework Affects the framework crates and the translator for them enhancement New feature or request

Comments

@madsmtm
Copy link
Owner

madsmtm commented Apr 17, 2024

These are quite annoying to work with without the core::ops::Bit* operators implemented.

Part of #310.

@madsmtm madsmtm added enhancement New feature or request A-framework Affects the framework crates and the translator for them labels Apr 17, 2024
@madsmtm
Copy link
Owner Author

madsmtm commented Apr 30, 2024

I think it makes sense to use bitflags directly, as it also exposes the Flags type, which is useful for users.

Though a bit unsure of how it should be implemented?

Maybe it's okay to force a dependency on it whenever a file uses NS_OPTIONS? Or maybe we should only cfg-gate the consts, so that the type itself is always available? Cfg-gating the implementations provided by bitflags! might be confusing, as in basically all cases where you want to use a NS_OPTIONS, you want the bitflags capabilities as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-framework Affects the framework crates and the translator for them enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant