-
Notifications
You must be signed in to change notification settings - Fork 920
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
Platform-Specific Enum Variants #3064
Comments
From #3056 (comment):
So when we get to re-introduce the |
From my comment:
This may not even affect |
Obviously there will always be APIs that should be behind a I agree with the overall sentiment, but this is a much bigger issue. Generally speaking I prefer keeping the API consistent over having half of the API follow a different pattern/rule. That said, if we can get consensus right here and now to remove the platform-extension-trait model I'm happy to go with that as well. @dhardy if you like to start the discussion in a new issue that would be great. I'm happy to do the implementation, but it's a lot of work to collect, read and answer throughout the process. |
I'm not sure why it has a separate issue, if enum is not a part of event, which a For the event I can't say at the current time what the idea could be, but we have PRs/Issues discussing platform specific event callbacks and so on. |
We already have a platform-specific event: This issue isn't for discussing |
@daxpedda it's not if you look into it, it's not marked as wayland/x11 special. |
I mean, you've linked to that issue from the |
What I'm saying is that it is platform-specific, we just didn't mark it as such. My hope is that if we establish some guidelines how Winit should do this in the future we can determine if we want to guard it behind a
Are you trying to say that you don't care about the consistency part here? E.g. let's use |
I do care, but Simply user setters/getters could have a Though, I have a goal to split event apart and have normal extension we have already... But regular simple enums could have a policy like |
Btw I have proposed a way to avoid I honestly dislike slapping I'm happy to figure this out later if this is not the right time. |
IIRC the reason |
@daxpedda maybe you could explain the extra variant(s) you'd want to add to |
The thing is thaw with trait based event dispatching you won't have enums like that at all, so I better not touch the way |
Just different versions of The first thing I want to add as soon as possible is Upon further contemplation I could have avoided this whole mess by just adding a method called |
This is also relevant for errors (see also #3067). Currently we do |
This is solved in the |
From #3056 (comment):
If we want to continue using the extension trait model for platform-specific features, I came up with the following idea that we could use for enums:
Alternatively we can always mark the enum
#[non_exhausive]
and addcfg
-gated variants.For consistency with the current API I would like to go with the first solution. The first thing I would like to apply this to is to re-introduce the
ControlFlow
enum after #3056.The text was updated successfully, but these errors were encountered: