- Documents: https://docs.rs/tzf-rs
- Original Go repo: https://github.com/ringsaturn/tzf
- Binary timezone data: https://github.com/ringsaturn/tzf-rel
- Geometry: use https://github.com/ringsaturn/geometry-rs which is https://github.com/tidwall/geometry's Rust port.
By default, the binary is built as well. If you don't want/need it, then build like this:
cargo build --no-default-features
Or add in the below way:
cargo add tzf-rs --no-default-features
It's expensive to init tzf-rs's Finder/FuzzyFinder/DefaultFinder, please consider reuse it or as a global var. Below is a global var example:
use lazy_static::lazy_static;
use tzf_rs::DefaultFinder;
lazy_static! {
static ref FINDER: DefaultFinder = DefaultFinder::new();
}
fn main() {
print!("{:?}\n", FINDER.get_tz_name(116.3883, 39.9289));
print!("{:?}\n", FINDER.get_tz_names(116.3883, 39.9289));
}
For reuse it,
racemap/rust-tz-service
is a
good example.
A Redis protocol demo could be used here: redizone.