Skip to main content

rtzlib/
lib.rs

1//! A tool to easily work with timezone lookups.
2//!
3//! # Examples
4#![cfg_attr(
5    feature = "tz-ned",
6    doc = r##"
7```
8use rtzlib::NedTimezone;
9use rtzlib::CanPerformGeoLookup;
10
11// Query a time zone for a given `(lng,lat)`.
12assert_eq!(
13    NedTimezone::lookup(-121., 46.)[0]
14        .identifier
15        .as_ref()
16        .unwrap(),
17    "America/Los_Angeles"
18);
19```
20"##
21)]
22// Directives.
23#![warn(rustdoc::broken_intra_doc_links, rust_2018_idioms, clippy::all, missing_docs)]
24#![allow(incomplete_features)]
25#![allow(stable_features)]
26// `coverage(off)` is nightly-only; the feature (and the attrs elsewhere in the crate) activate
27// only under `cargo llvm-cov` on nightly (which sets `coverage_nightly`). Inert on stable.
28#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
29// #![feature(async_closure)]
30// #![feature(test)]
31// #![feature(string_remove_matches)]
32// #![feature(fs_try_exists)]
33// #![feature(once_cell)]
34
35// Modules.
36
37pub mod geo;
38pub mod shared;
39pub use crate::geo::shared::CanPerformGeoLookup;
40
41#[cfg(feature = "tz-ned")]
42pub use rtz_core::geo::tz::ned::NedTimezone;
43
44#[cfg(feature = "tz-osm")]
45pub use rtz_core::geo::tz::osm::OsmTimezone;
46
47#[cfg(feature = "admin-osm")]
48pub use rtz_core::geo::admin::osm::OsmAdmin;
49
50#[cfg(feature = "wasm")]
51pub mod wasm;
52
53#[cfg(feature = "web")]
54pub mod web;
55#[cfg(feature = "web")]
56pub use crate::web::server_start;