https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-breakfast-49010

10/25/2019, 11:30 PM
why does
concrete_time
need to exist?
f

fancy-motherboard-24956

10/25/2019, 11:35 PM
In rust, a duration is designed to hide its implementation details from you. Among other things, that means you can’t serialize it. concrete_time gives you a
Duration
that exposes its implementation details so it can be serialized.
concrete_time::Duration
implements
From
and
Into
for the standard duration so you’re encouraged to use that in most places and only use the concrete_time one if you need the serialization.
Also, it has a
TimeSpan
since that’s useful for us
The
TimeSpan
also gives you some convenience conversion functions like to the protobuf time representation as these are useful for us.