pub struct GeoHashFixed { /* private fields */ }Expand description
A geohash encoded as a fixed-size byte array.
Supports precision 1–12 (matching the standard range).
Implementations§
Source§impl GeoHashFixed
impl GeoHashFixed
Sourcepub fn encode(lat: f64, lon: f64, precision: u8) -> Self
pub fn encode(lat: f64, lon: f64, precision: u8) -> Self
Encodes a (latitude, longitude) pair to the given precision (1–12).
If precision is outside 1–12, precision is clamped to the valid range.
Sourcepub fn decode(&self) -> (f64, f64)
pub fn decode(&self) -> (f64, f64)
Decodes the geohash to the (latitude, longitude) of the cell center.
Sourcepub fn neighbours(&self) -> [GeoHashFixed; 8]
pub fn neighbours(&self) -> [GeoHashFixed; 8]
Computes the 8 neighbouring geohash cells at the same precision.
Returns neighbours in the order:
[N, NE, E, SE, S, SW, W, NW].
At the antimeridian (lon ±180) longitude wraps. At the poles (lat ±90) latitude is clamped.
Trait Implementations§
Source§impl Clone for GeoHashFixed
impl Clone for GeoHashFixed
Source§fn clone(&self) -> GeoHashFixed
fn clone(&self) -> GeoHashFixed
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GeoHashFixed
Source§impl Debug for GeoHashFixed
impl Debug for GeoHashFixed
impl Eq for GeoHashFixed
Source§impl PartialEq for GeoHashFixed
impl PartialEq for GeoHashFixed
impl StructuralPartialEq for GeoHashFixed
Auto Trait Implementations§
impl Freeze for GeoHashFixed
impl RefUnwindSafe for GeoHashFixed
impl Send for GeoHashFixed
impl Sync for GeoHashFixed
impl Unpin for GeoHashFixed
impl UnsafeUnpin for GeoHashFixed
impl UnwindSafe for GeoHashFixed
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more