in
Clone
https://git.tahinli.com/Tahinli/in.git
0 watching0 forksRustAGPL-3.0528.7 KiB9215377Tahinli27 days ago37 commits
| 1 | //! UTC time stamps stored as text. The format is RFC 3339 with nine fractional digits and a `Z` |
| 2 | //! suffix. Its width is fixed, so comparing stamps as text gives time order. |
| 3 | |
| 4 | use Duration; |
| 5 | |
| 6 | use |
| 7 | |
| 8 | ; |
| 9 | |
| 10 | const FORMAT: & = |
| 11 | format_description!; |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | /// The current time as a stamp. |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | /// The stamp for `now + after`. Saturates at the largest representable time instead of panicking. |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | /// The stamp of a Unix time in whole seconds (an ID token's `iat`), or `None` when it is out of range. |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | /// The stamp for `now - before`. Saturates at the smallest representable time instead of panicking. |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 |