1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//! # Feature flags
//!
//! This crate exposes a number of features. These can be enabled or disabled as shown
//! [in Cargo's documentation](https://doc.rust-lang.org/cargo/reference/features.html). Features
//! are _disabled_ by default unless otherwise noted.
//!
//! Reliance on a given feature is always indicated alongside the item definition.
//!
//! - `std` (_enabled by default, implicitly enables `alloc`_)
//!
//! This enables a number of features that depend on the standard library.
//!
//! - `alloc` (_enabled by default via `std`_)
//!
//! Enables a number of features that require the ability to dynamically allocate memory.
//!
//! - `macros`
//!
//! Enables macros that provide compile-time verification of values and intuitive syntax.
//!
//! - `formatting` (_implicitly enables `std`_)
//!
//! Enables formatting of most structs.
//!
//! - `parsing`
//!
//! Enables parsing of most structs.
//!
//! - `local-offset` (_implicitly enables `std`_)
//!
//! This feature enables a number of methods that allow obtaining the system's UTC offset.
//!
//! - `large-dates`
//!
//! By default, only years within the ±9999 range (inclusive) are supported. If you need support
//! for years outside this range, consider enabling this feature; the supported range will be
//! increased to ±999,999.
//!
//! Note that enabling this feature has some costs, as it means forgoing some optimizations.
//! Ambiguities may be introduced when parsing that would not otherwise exist.
//!
//! - `serde`
//!
//! Enables [`serde`](https://docs.rs/serde) support for all types.
//!
//! - `serde-human-readable` (_implicitly enables `serde`, `formatting`, and `parsing`_)
//!
//! Allows `serde` representations to use a human-readable format. This is determined by the
//! serializer, not the user. If this feature is not enabled or if the serializer requests a
//! non-human-readable format, a format optimized for binary representation will be used.
//!
//! Libraries should never enable this feature, as the decision of what format to use should be up
//! to the user.
//!
//! - `rand` (_implicitly enables `rand08` and `rand09`_)
//!
//! Previously, this would enable support for `rand` 0.8. Since the release of `rand` 0.9, the
//! feature has been split into `rand08` and `rand09` to allow support for both versions. For
//! backwards compatibility and simplicity, this feature enables support for _both_ series.
//!
//! It is strongly recommended to enable `rand08` or `rand09` directly, as enabling `rand` will
//! needlessly pull in both versions.
//!
//! - `rand08`
//!
//! Enables [`rand` 0.8](https://docs.rs/rand/0.8) support for all types.
//!
//! - `rand09`
//!
//! Enables [`rand` 0.9](https://docs.rs/rand/0.9) support for all types.
//!
//! - `quickcheck` (_implicitly enables `alloc`_)
//!
//! Enables [quickcheck](https://docs.rs/quickcheck) support for all types.
//!
//! - `wasm-bindgen`
//!
//! Enables [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) support for converting
//! [JavaScript dates](https://rustwasm.github.io/wasm-bindgen/api/js_sys/struct.Date.html), as
//! well as obtaining the UTC offset from JavaScript.
extern crate alloc;
extern crate std;
pub use convert;
pub use crate Date;
pub use crate Duration;
pub use crate Error;
pub use crate Instant;
pub use crate Month;
pub use crate OffsetDateTime;
pub use crate PrimitiveDateTime;
pub use crate Time;
pub use crate UtcDateTime;
pub use crate UtcOffset;
pub use crate Weekday;
/// An alias for [`std::result::Result`] with a generic error from the time crate.
pub type Result<T> = Result;
/// This is a separate function to reduce the code size of `expect_opt!`.
const !
/// Returns the size of the pointed-to value in bytes.
///
/// This is a `const fn` in the standard library starting in Rust 1.85. When MSRV is at least that,
/// this can be removed.
const