Open dev-ardi opened 6 months ago
A Duration
is serialized as seconds and nanoseconds and is meant to be a "time since" something
A Time
is a "time of day" which is a different unit and would not be interchangeable. If we added serialize/deserialzie support, it would be to allow exclusively serializing/deserializing as just a Time
and not a full DateTime
.,
Right not Time
has no serde implementation, which makes it impossible to use if you're using serde.
While it is a "time of day" it can be used as a duration too, if you interpret it that way!
execute_command_in = 00:10:10
can mean a duration indeed.
I'm not pushing for Duration
specifically even if it makes sense for me, it was just an idea.
I'm fine if it deserializes into a toml::Value::Time
, and then if it makes sense we can impl Into<Duration> for Time
I'm fine with serde support for those all of the date/time types but Duration
I am against Duration
for now.
Are you against deserializing into Duration
or having an impl Into<Duration> for Time
Both.
I would expect time to convert pretty naturally to
std::time::Duration
but that's not the case