Folks,

I've recently realized that durations we use in mesos (stout's `Duration`
and `DurationInfo` protobuf) are based on signed integers. Negative
duration concept is a bit strange to me, so I googled around a bit and
found an interesting thread [1].

Was it an explicit intention to allow `Duration`s to be negative? Do we use
this feature? If yes, maybe we can introduce a class representing time
delta (can be negative) and base `Duration` on top of it guaranteeing it is
always non-negative?

My ultimate intention is to avoid boilerplate code that validates every
single instance of `Duration` in the codebase. I'd rather have a class with
guarantees certain invariants.

[1] https://internals.rust-lang.org/t/unsigned-version-of-duration/893/2

Reply via email to