-
Notifications
You must be signed in to change notification settings - Fork 349
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
Make io related enums to support serde Serialize/Deserialize #769
Comments
We've been historically avoiding adding serde directly because we don't really have control over these types -- fundamentally they could change in a way that breaks serde compatibility. How do you feel about making a proxy type (ie, |
I already did, with huge chunk of copy-pasted enum definition. |
Since Rust promises the pattern-patching will always be exhaustive, I do think that your approach is actually future proofed. Annoying, yes, but future proofed. I do the same thing with the imgui style settings for the same reason as above. For what it's worth, the reasoning that "because imgui controls this type means we can't serde it" is weak imo. If there's sufficient interest in trying, I'd probably try! |
Is your feature request related to a problem? Please describe.
Because
imgui::Key
does not supportserde
, this kind of thing is not possible.Providing proxy enum to use
#[serde(remote="...")]
is kind of viable, but not recommendable sinceimgui::Key
has 140 entries.Describe the solution you'd like
Make io related enums of this crate to derive
serde::{Serialize, Deserialize}
.The text was updated successfully, but these errors were encountered: