Module time::duration

source ·
Expand description

The Duration struct and its associated impls.

Macros

  • Implement Mul (reflexively) and Div for Duration for various types.
  • item 🔒
    Format the first item that produces a value greater than 1 and then break.
  • item 🔒
    Format a single item.
  • This is adapted from the std implementation, which uses mostly bit operations to ensure the highest precision: https://github.com/rust-lang/rust/blob/3a37c2f0523c87147b64f1b8099fc9df22e8c53e/library/core/src/time.rs#L1262-L1340 Changes from std are marked and explained below.

Structs

  • A span of time with nanosecond precision.

Enums

  • Padding 🔒
    By explicitly inserting this enum where padding is expected, the compiler is able to better perform niche value optimization.

Constants