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
//! `timezone-data` provides direct, allocation-free access to IANA timezone
//! data, exposing the transitions, zone types, POSIX TZ rules, leap seconds,
//! and metadata that most timezone libraries keep private.
//!
//! Timezone data is compiled from the official IANA source and embedded in the
//! crate as pre-parsed static objects — one per zone — so there is no
//! dependency on the host system's timezone files and nothing is parsed at
//! runtime. The crate is `#![no_std]` and never allocates: a lookup is a binary
//! search over `&'static` data.
//!
//! # Example
//!
//! ```
//! let z = timezone_data::load("America/New_York").unwrap();
//!
//! // Inspect zone types (EST, EDT, ...).
//! for zt in z.types() {
//! // zt.abbrev, zt.offset, zt.is_dst
//! let _ = zt;
//! }
//!
//! // Look up the active zone at a specific Unix timestamp.
//! let zt = z.lookup(1_700_000_000);
//! assert_eq!(zt.abbrev, "EST");
//!
//! // Compute future transitions from the POSIX TZ rule.
//! if let Some(rule) = z.extend() {
//! let (start, end) = rule.transitions_for_year(2025).unwrap();
//! assert!(start < end);
//! }
//! ```
pub use Error;
pub use ;
pub use ;
pub use ;
/// Loads a [`Zone`] by IANA timezone name from the embedded database.
///
/// An empty name or `"UTC"` resolves to the `UTC` zone.
/// Loads a [`Zone`] by name, falling back to case-insensitive matching.
/// Returns an iterator over every IANA timezone name in the embedded database.