Skip to content
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

Implement Serialize and Deserialize for Date and Time #763

Closed
loqusion opened this issue Jul 28, 2024 · 1 comment · Fixed by #773
Closed

Implement Serialize and Deserialize for Date and Time #763

loqusion opened this issue Jul 28, 2024 · 1 comment · Fixed by #773
Labels
A-serde Area: Serde integration C-enhancement Category: Raise on the bar on expectations

Comments

@loqusion
Copy link
Contributor

The v1.0.0 TOML spec allows omission of the time or date portion of a local date-time to represent a local date or a local time respectively. However, there is currently no implementation for Serialize or Deserialize for Date or Time in the toml crate. While it is possible for consumers of toml to use Datetime, it would be better to be able to use Date/Time directly to more clearly communicate intent, prevent mistakes in making runtime assertions, and avoid the need to manually unwrap the date/time Options.

NOTE: I am not suggesting we interpret a local time as a duration as suggested in #696. RFC 3339 explicitly does not cover time intervals.

@epage epage added A-serde Area: Serde integration C-enhancement Category: Raise on the bar on expectations labels Jul 29, 2024
@epage
Copy link
Member

epage commented Jul 29, 2024

I am fine with someone implementing this. I would expect the impl's to delegate to Datetime and then error if an unexpected field is set so we centralize all knowledge of the serde hacks we use to deserialize this time (and ensure full compatibility between them)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-serde Area: Serde integration C-enhancement Category: Raise on the bar on expectations
Projects
None yet
2 participants