Debian Codegraph @

debian/missing-sources/time/src/lib.rs

raw symbols SCIP
1 //! # Feature flags
2 //!
3 //! This crate exposes a number of features. These can be enabled or disabled as shown
4 //! [in Cargo's documentation](https://doc.rust-lang.org/cargo/reference/features.html). Features
5 //! are _disabled_ by default unless otherwise noted.
6 //!
7 //! Reliance on a given feature is always indicated alongside the item definition.
8 //!
9 //! - `std` (_enabled by default, implicitly enables `alloc`_)
10 //!
11 //! This enables a number of features that depend on the standard library.
12 //!
13 //! - `alloc` (_enabled by default via `std`_)
14 //!
15 //! Enables a number of features that require the ability to dynamically allocate memory.
16 //!
17 //! - `macros`
18 //!
19 //! Enables macros that provide compile-time verification of values and intuitive syntax.
20 //!
21 //! - `formatting` (_implicitly enables `std`_)
22 //!
23 //! Enables formatting of most structs.
24 //!
25 //! - `parsing`
26 //!
27 //! Enables parsing of most structs.
28 //!
29 //! - `local-offset` (_implicitly enables `std`_)
30 //!
31 //! This feature enables a number of methods that allow obtaining the system's UTC offset.
32 //!
33 //! - `large-dates`
34 //!
35 //! By default, only years within the ±9999 range (inclusive) are supported. If you need support
36 //! for years outside this range, consider enabling this feature; the supported range will be
37 //! increased to ±999,999.
38 //!
39 //! Note that enabling this feature has some costs, as it means forgoing some optimizations.
40 //! Ambiguities may be introduced when parsing that would not otherwise exist.
41 //!
42 //! - `serde`
43 //!
44 //! Enables [`serde`](https://docs.rs/serde) support for all types.
45 //!
46 //! - `serde-human-readable` (_implicitly enables `serde`, `formatting`, and `parsing`_)
47 //!
48 //! Allows `serde` representations to use a human-readable format. This is determined by the
49 //! serializer, not the user. If this feature is not enabled or if the serializer requests a
50 //! non-human-readable format, a format optimized for binary representation will be used.
51 //!
52 //! Libraries should never enable this feature, as the decision of what format to use should be up
53 //! to the user.
54 //!
55 //! - `rand` (_implicitly enables `rand08` and `rand09`_)
56 //!
57 //! Previously, this would enable support for `rand` 0.8. Since the release of `rand` 0.9, the
58 //! feature has been split into `rand08` and `rand09` to allow support for both versions. For
59 //! backwards compatibility and simplicity, this feature enables support for _both_ series.
60 //!
61 //! It is strongly recommended to enable `rand08` or `rand09` directly, as enabling `rand` will
62 //! needlessly pull in both versions.
63 //!
64 //! - `rand08`
65 //!
66 //! Enables [`rand` 0.8](https://docs.rs/rand/0.8) support for all types.
67 //!
68 //! - `rand09`
69 //!
70 //! Enables [`rand` 0.9](https://docs.rs/rand/0.9) support for all types.
71 //!
72 //! - `quickcheck` (_implicitly enables `alloc`_)
73 //!
74 //! Enables [quickcheck](https://docs.rs/quickcheck) support for all types.
75 //!
76 //! - `wasm-bindgen`
77 //!
78 //! Enables [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) support for converting
79 //! [JavaScript dates](https://rustwasm.github.io/wasm-bindgen/api/js_sys/struct.Date.html), as
80 //! well as obtaining the UTC offset from JavaScript.
81
82 #![doc(html_playground_url = "https://play.rust-lang.org")]
83 #![cfg_attr(docsrs, feature(doc_cfg, doc_notable_trait))]
84 #![no_std]
85 #![doc(html_favicon_url = "https://avatars0.githubusercontent.com/u/55999857")]
86 #![doc(html_logo_url = "https://avatars0.githubusercontent.com/u/55999857")]
87 #![doc(test(attr(deny(warnings))))]
88
89 #[allow(unused_extern_crates)]
90 #[cfg(feature = "alloc")]
91 extern crate allocrust-analyzer cargo time 0.3.47 alloc/;
92
93 #[cfg(feature = "std")]
94 extern crate stdrust-analyzer cargo time 0.3.47 std/;
95
96 mod daterust-analyzer cargo time 0.3.47 date/;
97 mod durationrust-analyzer cargo time 0.3.47 duration/;
98 pub mod errorrust-analyzer cargo time 0.3.47 error/;
99 pub mod extrust-analyzer cargo time 0.3.47 ext/;
100 #[cfg(any(feature = "formatting", feature = "parsing"))]
101 pub mod format_descriptionrust-analyzer cargo time 0.3.47 format_description/;
102 #[cfg(feature = "formatting")]
103 pub mod formattingrust-analyzer cargo time 0.3.47 formatting/;
104 mod hintrust-analyzer cargo time 0.3.47 hint/;
105 #[cfg(feature = "std")]
106 mod instantrust-analyzer cargo time 0.3.47 instant/;
107 mod internal_macrosrust-analyzer cargo time 0.3.47 internal_macros/;
108 mod interoprust-analyzer cargo time 0.3.47 interop/;
109 #[cfg(feature = "macros")]
110 pub mod macros;
111 mod monthrust-analyzer cargo time 0.3.47 month/;
112 mod offset_date_timerust-analyzer cargo time 0.3.47 offset_date_time/;
113 #[cfg(feature = "parsing")]
114 pub mod parsingrust-analyzer cargo time 0.3.47 parsing/;
115 mod primitive_date_timerust-analyzer cargo time 0.3.47 primitive_date_time/;
116 #[cfg(feature = "quickcheck")]
117 mod quickcheck;
118 #[cfg(feature = "rand08")]
119 mod rand08;
120 #[cfg(feature = "rand09")]
121 mod rand09;
122 #[cfg(feature = "serde")]
123 pub mod serde;
124 mod sysrust-analyzer cargo time 0.3.47 sys/;
125 #[cfg(test)]
126 mod tests;
127 mod timerust-analyzer cargo time 0.3.47 time/;
128 mod utc_date_timerust-analyzer cargo time 0.3.47 utc_date_time/;
129 mod utc_offsetrust-analyzer cargo time 0.3.47 utc_offset/;
130 pub mod utilrust-analyzer cargo time 0.3.47 util/;
131 mod weekdayrust-analyzer cargo time 0.3.47 weekday/;
132
133 pub use time_corerust-analyzer cargo time-core 0.1.8 crate/::convertrust-analyzer cargo time-core 0.1.8 convert/;
134
135 pub use craterust-analyzer cargo time 0.3.47 crate/::daterust-analyzer cargo time 0.3.47 date/::Daterust-analyzer cargo time 0.3.47 date/Date#;
136 pub use craterust-analyzer cargo time 0.3.47 crate/::durationrust-analyzer cargo time 0.3.47 duration/::Durationrust-analyzer cargo time 0.3.47 duration/Duration#;
137 pub use craterust-analyzer cargo time 0.3.47 crate/::errorrust-analyzer cargo time 0.3.47 error/::Errorrust-analyzer cargo time 0.3.47 error/Error#;
138 #[doc(hidden)]
139 #[cfg(feature = "std")]
140 #[expect(deprecated)]
141 pub use craterust-analyzer cargo time 0.3.47 crate/::instantrust-analyzer cargo time 0.3.47 instant/::Instantrust-analyzer cargo time 0.3.47 instant/Instant#;
142 pub use craterust-analyzer cargo time 0.3.47 crate/::monthrust-analyzer cargo time 0.3.47 month/::Monthrust-analyzer cargo time 0.3.47 month/Month#;
143 pub use craterust-analyzer cargo time 0.3.47 crate/::offset_date_timerust-analyzer cargo time 0.3.47 offset_date_time/::OffsetDateTimerust-analyzer cargo time 0.3.47 offset_date_time/OffsetDateTime#;
144 pub use craterust-analyzer cargo time 0.3.47 crate/::primitive_date_timerust-analyzer cargo time 0.3.47 primitive_date_time/::PrimitiveDateTimerust-analyzer cargo time 0.3.47 primitive_date_time/PrimitiveDateTime#;
145 pub use craterust-analyzer cargo time 0.3.47 crate/::timerust-analyzer cargo time 0.3.47 time/::Timerust-analyzer cargo time 0.3.47 time/Time#;
146 pub use craterust-analyzer cargo time 0.3.47 crate/::utc_date_timerust-analyzer cargo time 0.3.47 utc_date_time/::UtcDateTimerust-analyzer cargo time 0.3.47 utc_date_time/UtcDateTime#;
147 pub use craterust-analyzer cargo time 0.3.47 crate/::utc_offsetrust-analyzer cargo time 0.3.47 utc_offset/::UtcOffsetrust-analyzer cargo time 0.3.47 utc_offset/UtcOffset#;
148 pub use craterust-analyzer cargo time 0.3.47 crate/::weekdayrust-analyzer cargo time 0.3.47 weekday/::Weekdayrust-analyzer cargo time 0.3.47 weekday/Weekday#;
149
150 /// An alias for [`std::result::Result`] with a generic error from the time crate.
151 pub type Resultrust-analyzer cargo time 0.3.47 Result#<T> = corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, Errorrust-analyzer cargo time 0.3.47 error/Error#>;