pub enum Mantissa {
Digits(u32),
Arbitrary(Decimal),
}
Expand description
Stores the precision of a Timestamp’s fractional seconds, if present. This type is not self-contained; if the Timestamp has a precision that is less than or equal to nanoseconds (i.e. fewer than 10 digits), the fractional seconds value will be stored in the Timestamp’s NaiveDateTime component and the Mantissa will indicate the number of digits from that value that should be used. If the precision is 10 or more digits, the Mantissa will store the value itself as a Decimal with the correct precision.
Variants§
Digits(u32)
The number of digits of precision in the Timestamp’s fractional seconds. For example, a
value of 3
would indicate millisecond precision. A value of 6
would indicate
microsecond precision. All precisions less than or equal to nanoseconds should use
this representation when possible.
Arbitrary(Decimal)
Specifies the fractional seconds precisely as a Decimal
in the range >= 0
and < 1
.
The Decimal will have the correct precision; the complete value can and should be used.
This representation should only be used for precisions greater than nanoseconds as can
require allocations.