-
Notifications
You must be signed in to change notification settings - Fork 189
Add time/chrono to access date/time values #159
Comments
Some advice from @dtolnay:
|
is this what needs to be done?
Parts 1 and 2 sound easy, but to the serializer, aren't the chrono types indistinguishable from strings, making part 3 impossible? Also, now that I think about it, wouldn't the sensible option for Edit: The more I look at chrono's serde integration, the more it seems like it's doing the wrong thing by looking exactly like a string. |
@quadrupleslap oh I don't think we'll want a toml date/time to be directly deserializable to a chrono date/time, but rather what I think we'll want to do is to provide baked-in conversion methods for the |
Oh, okay, but that means auto-derived Deserialize won't work for structs with chrono::DateTime inside them, which is a bit of a shame. |
@alexcrichton I need this again, so I'm trying to implement it. Should I just add |
@quadrupleslap ok awesome! I'm not too familiar with chrono so I'm fine w/ whatever works for chrono! |
This is a massive breaking change, but the Datetime type should probably be split up into (Also, it's strange how I keep needing this exactly once every year.) |
In the absence of full chrono integration, would it be possible to expose currently private members of the datetime struct? Currently in rtoml (python wrapper for this library) I'm having to use |
Seems reasonable to me to add! |
Maintenance of this crate has moved to the https://github.com/toml-rs/toml repo. As a heads up, we plan to move Closing this out. If this is still a problem, feel free to recreate this issue in the new repo. |
Currently, date/time values are only represented by internal structures that only support conversion to/from strings. Adding the ability to convert these types to structures from the time and/or chrono crate would enable people to deal wth these types much more nicely.
cc Rustaceans/rust-cologne#29
The text was updated successfully, but these errors were encountered: