pub struct Finder { /* private fields */ }
Expand description
Finder use a fine tuned Ray casting algorithm implement geometry-rs which is Rust port of geometry by Josh Baker.
Implementations§
source§impl Finder
impl Finder
sourcepub fn from_pb(tzs: Timezones) -> Finder
pub fn from_pb(tzs: Timezones) -> Finder
from_pb
is used when you can customed timezone data, as long as
it’s compatible with Proto’s desc.
sourcepub fn new() -> Finder
pub fn new() -> Finder
new is for most general usacase.
Example:
use tzf_rs::Finder;
let finder = Finder::new();
sourcepub fn get_tz_name(&self, lng: f64, lat: f64) -> &str
pub fn get_tz_name(&self, lng: f64, lat: f64) -> &str
Example:
use tzf_rs::Finder;
let finder = Finder::new();
assert_eq!("Asia/Shanghai", finder.get_tz_name(116.3883, 39.9289));
sourcepub fn timezonenames(&self) -> Vec<&str>
pub fn timezonenames(&self) -> Vec<&str>
Example:
use tzf_rs::Finder;
let finder = Finder::new();
println!("{:?}", finder.timezonenames());