You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### [View the Rustdoc](https://datetime.rustdocs.org/zoneinfo_parse/index.html)
14
+
### [View the Rustdoc](https://docs.rs/zoneinfo_parse)
15
15
16
16
17
17
## Format
18
18
19
-
The zoneinfo files contains `Zone`, `Rule`, and `Link` information. Each type of line forms a variant in the [`line::Line`](https://datetime.rustdocs.org/zoneinfo_parse/line/enum.Line.html) enum.
19
+
The zoneinfo files contains `Zone`, `Rule`, and `Link` information. Each type of line forms a variant in the `line::Line` enum.
20
20
21
21
To get started, here are a few lines representing what time is like in the `Europe/Madrid` time zone:
22
22
@@ -31,7 +31,7 @@ The first line is a comment. The second starts with `Zone`, so we know
31
31
So parsing these five lines would return the five following results:
32
32
33
33
- A `line::Line::Space` for the comment, because the line doesn’t contain any information (but isn’t strictly *invalid* either).
34
-
- A `line::Line::Zone` for the first `Zone` entry. This contains a [`Zone` struct](https://datetime.rustdocs.org/zoneinfo_parse/line/struct.Zone.html) that holds the name of the zone. All the other fields are stored in the [`ZoneInfo` struct](https://datetime.rustdocs.org/zoneinfo_parse/line/struct.ZoneInfo.html).
34
+
- A `line::Line::Zone` for the first `Zone` entry. This contains a `Zone` struct that holds the name of the zone. All the other fields are stored in the `ZoneInfo` struct.
35
35
- A `line::Line::Continuation` for the next entry. This is different from the line above as it doesn’t contain a name field; it only has the information in a `ZoneInfo` struct.
36
36
- The fourth line contains the same types of data as the third.
37
37
- As does the fifth.
@@ -44,23 +44,23 @@ Lines with rule definitions look like this:
44
44
Rule Spain 1918 only - Apr 15 23:00s 1:00 S
45
45
Rule Spain 1919 only - Apr 5 23:00s 1:00 S
46
46
47
-
All these lines follow the same pattern: A `line::Line::Rule` that contains a [`Rule` struct](https://datetime.rustdocs.org/zoneinfo_parse/line/struct.Rule.html), which has a field for each column of data.
47
+
All these lines follow the same pattern: A `line::Line::Rule` that contains a `Rule` struct, which has a field for each column of data.
48
48
49
49
Finally, there are lines that link one zone to another’s name:
50
50
51
51
Link Europe/Prague Europe/Bratislava
52
52
53
-
The [`Link` struct](https://datetime.rustdocs.org/zoneinfo_parse/line/struct.Link.html) simply contains the names of both the existing and new time zones.
53
+
The `Link` struct simply contains the names of both the existing and new time zones.
54
54
55
55
56
56
## Interpretation
57
57
58
58
Once the input lines have been parsed, they must be *interpreted* to form a table of time zone data.
59
59
60
-
The easiest way to do this is with a [`TableBuilder`](https://datetime.rustdocs.org/zoneinfo_parse/table/struct.TableBuilder.html). You can add various lines to the builder, and it will throw an error as soon as it detects that something’s wrong, such as a duplicate or a missing entry. When all the lines have been fed to the builder, you can use the `build` method to produce a [`Table`](https://datetime.rustdocs.org/zoneinfo_parse/table/struct.Table.html) containing fields for the rule, zone, and link lines.
60
+
The easiest way to do this is with a `TableBuilder`. You can add various lines to the builder, and it will throw an error as soon as it detects that something’s wrong, such as a duplicate or a missing entry. When all the lines have been fed to the builder, you can use the `build` method to produce a `Table` containing fields for the rule, zone, and link lines.
61
61
62
62
63
63
64
64
## Example program
65
65
66
-
This crate is used to produce the data for the [`zoneinfo-data` crate](https://github.com/rust-datetime/zoneinfo-data). For an example of its use, see the bundled [data crate builder](https://github.com/rust-datetime/zoneinfo-data).
66
+
This crate is used to produce the data for the [`zoneinfo-data` crate](https://github.com/rust-datetime/zoneinfo-data). For an example of its use, see the bundled [data crate builder](https://github.com/rust-datetime/zoneinfo-parse/tree/master/data-crate-builder).
0 commit comments