Skip to content
Discussion options

You must be logged in to vote

Unlike a SignedDuration which is just a single 96-bit integer number of nanoseconds, a Span is a more complicated type that keeps track of each individual unit separately. In theory, you could express a maximal Span by building a Span using the maximum supported values for each unit. But I think this is somewhat odd, and it's not clear if there is a good use case for it. Moreover, a Span itself doesn't support Eq or Ord comparisons directly, and instead you must call Span::compare. In part so that time zones/varying quantities can be handled, but also because real work needs to be done to normalize the two Spans being compared. For example, 120.minutes() versus 2.hours(). These are distin…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jessekrubin
Comment options

@BurntSushi
Comment options

BurntSushi Sep 25, 2025
Maintainer Author

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants