Struct tzf_rs::FuzzyFinder
source · pub struct FuzzyFinder { /* private fields */ }
Expand description
FuzzyFinder store all preindex’s tiles data in a HashMap, It iterate all zoom levels for input’s longitude and latitude to build map key to to check if in map.
It’s is very fast and use about 400ns to check if has preindex. It work for most places on earch and here is a quick loop of preindex data:
Implementations
sourceimpl FuzzyFinder
impl FuzzyFinder
pub fn from_pb(tzs: PreindexTimezones) -> FuzzyFinder
sourcepub fn new() -> FuzzyFinder
pub fn new() -> FuzzyFinder
use tzf_rs::FuzzyFinder;
let finder = FuzzyFinder::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::FuzzyFinder;
let finder = FuzzyFinder::new();
assert_eq!("Asia/Shanghai", finder.get_tz_name(116.3883, 39.9289));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FuzzyFinder
impl Send for FuzzyFinder
impl Sync for FuzzyFinder
impl Unpin for FuzzyFinder
impl UnwindSafe for FuzzyFinder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more