You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to serialize a RelativeDuration with serde. Because sometimes I want to save a duration to disk. I can easily enough work around it with an enum holding days or months for my case, but it would be easier if RelativeDuration was serializable already.
Perhaps if extra deps are not desirable it could be behind a feature?
If there is interest in this I would consider doing a PR.
The text was updated successfully, but these errors were encountered:
If you were to implement a subset of ISO 8601 notation under a [serde] feature flag then I would accept that. That means, for example, that RelativeDuration::months(1) + Duration::milliseconds(10) would serialize to P1M0.01S
Ah yes, it wasn't until after I wrote the wishlist that I discovered as you say that Chrono don't provide a serialize impl for their Duration type, even with the [serde] feature. In the end for my applicaton I have just saved 'days' and 'months' values and convert them from/to RelativeDurations when serializing/unseriaalizing, it was easier than thinking about the proper way to do it in chronoutil.
If I reassess (or if there were more interest from others) later, I may look at a PR again and your notes are helpful. Thanks
I'd like to be able to serialize a RelativeDuration with serde. Because sometimes I want to save a duration to disk. I can easily enough work around it with an enum holding days or months for my case, but it would be easier if RelativeDuration was serializable already.
Perhaps if extra deps are not desirable it could be behind a feature?
If there is interest in this I would consider doing a PR.
The text was updated successfully, but these errors were encountered: