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
//! Time zone name helpers.
//!
//! This module exposes [`UTC_ALIASES`] and [`tz_names`], used internally by the
//! parser and formatter to recognize IANA time zone identifiers in input strings
//! and to enumerate available zones at runtime.
//!
//! ## Behavior by feature
//!
//! | Configuration | [`tz_names`] yields |
//! |---------------|---------------------|
//! | `jiff-tz` or `jiff-tz-bundle` (with `alloc`) | All IANA identifiers from the bundled Jiff TZ database |
//! | `alloc` without `jiff-tz` | [`UTC_ALIASES`] only |
//! | `no_alloc` | [`UTC_ALIASES`] only (no heap) |
//!
//! Time zone–aware formatting and calendar math ([`Dt::to_str_in_tz`](../struct.Dt.html#method.to_str_in_tz),
//! [`Dt::add_hr_tz`](../struct.Dt.html#method.add_hr_tz), etc.) require the `jiff-tz` feature.
//! [`tz_names`] is independent of those APIs but uses the same database when `jiff-tz` is enabled.
//!
//! ## Examples
//!
//! Iterate over IANA time zone names when `jiff-tz` is enabled:
//!
//! ```rust
//! # #[cfg(feature = "jiff-tz")]
//! # {
//! use deep_time::tz::tz_names;
//!
//! let mut found_london = false;
//! for name in tz_names() {
//! if name.as_str() == "Europe/London" {
//! found_london = true;
//! break;
//! }
//! }
//! assert!(found_london);
//! # }
//! ```
//!
//! Without `jiff-tz`, only UTC aliases are returned:
//!
//! ```rust
//! # #[cfg(not(any(feature = "jiff-tz-bundle", feature = "jiff-tz")))]
//! # {
//! use deep_time::tz::{tz_names, UTC_ALIASES};
//!
//! let count = tz_names().count();
//! assert_eq!(count, UTC_ALIASES.len());
//! assert!(tz_names().any(|n| n.as_str() == "UTC"));
//! # }
//! ```
use crateLiteStr;
/// Well-known aliases for UTC accepted in parsed date/time strings.
pub static UTC_ALIASES: & = &;
/// Returns an iterator over known time zone names as [`LiteStr<49>`](../struct.LiteStr.html).
///
/// With `jiff-tz` or `jiff-tz-bundle`, yields every IANA identifier from the Jiff
/// time zone database. Otherwise yields only [`UTC_ALIASES`].
// alloc version (uses Jiff when available)
// no-alloc version (only UTC aliases)