-
-
Notifications
You must be signed in to change notification settings - Fork 785
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
Impl Serialize/Deserialize for std::ops::{Bound, RangeFrom, RangeTo, RangeToInclusive} #1466
Conversation
Could you explain more about your use case for these impls? How is all of this going to be used in what you are building? |
Hi. It's useful because Diesel uses As for Range-types, I find it appropriate to use precise types for ranges (both with Diesel and Serde). Currently I propose changes to Diesel (diesel-rs/diesel#1971) to add the ability to use these types with Anyway, if you think that Range-types should not be added, I'm glad to revise PR. |
It sounds like the two reasons for wanting the Bound impls is Diesel's choice of Bound to represent ranges and your code's choice of doing queries and json based on the same struct. What would be the impact on your code if we decide not to provide these impls in Serde? Probably you would need to apply a serialize_with / deserialize_with function on the field containing Bound right? |
Yep, that's right. |
Thanks, I merged the PR but pared it down to just the Bound impls in a later commit. I am not opposed to the other impls but I would prefer not to accept code that I don't know of anyone wanting to use. Published in 1.0.86. |
Thanks! We've decided to use |
Implemented
Serialize
andDeserialize
traits for various interval-related types fromstd
.Could help me to setup
cfg
s etc properly?