Skip to content

Get timezone via longitude&latitude in Rust in a fast way

License

Notifications You must be signed in to change notification settings

ginnyTheCat/tzf-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIP: tzf's Rust port. Rust Documentation codecov

Build options

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

Best practice

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.

Bindings

About

Get timezone via longitude&latitude in Rust in a fast way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%