Expand description
Defines boundary types and their corresponding error values.
The main trait in this module is Bounds. It is implemented by each of
several boundary types describing a range of contiguous values used by Jiff.
For example, Year corresponds to the range of support calendar year values.
Each range type has concrete methods defined on it that simply forward to its
corresponding method on Bounds. For example, Year::check forwards to the
default implementation of Bounds::check. These concrete wrappers exist to
make calling the routines more ergonomic. For example, they don’t require that
the Bounds trait be in scope. Additionally, a Year::checkc concrete
method is provide for use in const contexts. This is not available on the
Bounds trait because generics are not yet supported (as of 2026-02-13) in
a const context.
Modules§
- const_
check - Provides routines usable in a
constcontext for checking boundary values. - const_
checked_ add - Provides routines usable in a
constcontext for checked arithmetic.
Structs§
- Bounds
Error - The error type used by the trait implementations of
Boundsin this crate. - Civil
DayNanosecond - The supported range of nanoseconds in a single civil day.
- Civil
DaySecond - The supported range of seconds in a single civil day.
- Day
- The supported range of “day of month.”
- DayOf
Year - The supported range of “day of year.”
- DayOf
Year NoLeap - The supported range of “day of year,” but never including Feb 29.
- Delta
Seconds - The range of seconds for the possible differences between any two pairs
of
(timestamp, offset). - Hour
- The range of hours supported.
- ISOWeek
- The supported range of week numbers in the ISO 8601 week calendar.
- ISOYear
- The supported range of year numbers in the ISO 8601 week calendar.
- Microsecond
- The supported range of microsecond values.
- Millisecond
- The supported range of millisecond values.
- Minute
- The supported range of minute values.
- Month
- The supported range of month values.
- Nanosecond
- The supported range of nanosecond values.
- NthWeekday
- The supported range of values for getting the “nth weekday” from a date.
- NthWeekday
OfMonth - The supported range of values for getting the “nth weekday of a month” from a particular date.
- Offset
Hours - The number of hours allowed in a time zone offset.
- Offset
Minutes - The supported range of “minute” component of a time zone offset.
- Offset
Seconds - The supported range of “second” component of a time zone offset.
- Offset
Total Seconds - The supported range of time zone offsets, expressed in units of seconds.
- Range
Error - An error type that combines
BoundsErrorwith other custom error variants. - RawBounds
Error - An error type that encodes information from an implementation of
Bounds. - Second
- The supported range of second values.
- Signed
Subsec Nanosecond - The supported range of a timestamp’s subsecond component.
- Subsec
Nanosecond - The supported range of fractional seconds, expressed in units of nanoseconds.
- Timestamp
Arithmetic Nanosecond - An error that occurs when doing arithmetic on a timestamp overflows
the
i32representation of a nanosecond. - Unix
Epoch Days - The supported range of days from the Unix epoch for the Gregorian calendar.
- Unix
Epoch Microseconds - Unix
Epoch Milliseconds - Unix
Epoch Seconds - The supported range of seconds for the difference between any two
values of
UnixEpochDays. - Weekday
Monday One - The supported range of 1-offset week day values when weeks start on Monday.
- Weekday
Monday Zero - The supported range of 0-offset week day values when weeks start on Monday.
- Weekday
Sunday One - The supported range of 1-offset week day values when weeks start on Sunday.
- Weekday
Sunday Zero - The supported range of 0-offset week day values when weeks start on Sunday.
- Year
- The range of years supported.
- YearBCE
- The range of years supported for Before Common Era (BCE).
- YearCE
- The range of years supported for the Common Era (CE).
Enums§
- Sign
- A representation of a numeric sign.