pub struct GeoHash { /* private fields */ }Expand description
GeoHash value encoded as base32 string
Implementations§
Source§impl GeoHash
impl GeoHash
Sourcepub const fn encode(coord: Coordinate, len: usize) -> Option<Self>
pub const fn encode(coord: Coordinate, len: usize) -> Option<Self>
Creates len long geohash for specified coordinates coord.
Returns None if len is not within 1..=12 range
Prefer to use Codec to ensure len is valid at compile time when possible
Sourcepub const fn from_str(text: &str) -> Self
pub const fn from_str(text: &str) -> Self
Creates geohash from string, validating its length within 1..=12 with panic in case of failure
Sourcepub const fn try_from_str(text: &str) -> Option<Self>
pub const fn try_from_str(text: &str) -> Option<Self>
Creates geohash from string, validating its length within 1..=12
Sourcepub const fn decode_bbox(&self) -> Result<Bbox, DecodeError>
pub const fn decode_bbox(&self) -> Result<Bbox, DecodeError>
Decodes geohash into its cell’s coordinates
Trait Implementations§
Source§impl<'a> Deserialize<'a> for GeoHash
impl<'a> Deserialize<'a> for GeoHash
Source§fn deserialize<D: Deserializer<'a>>(des: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'a>>(des: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Copy for GeoHash
Auto Trait Implementations§
impl Freeze for GeoHash
impl RefUnwindSafe for GeoHash
impl Send for GeoHash
impl Sync for GeoHash
impl Unpin for GeoHash
impl UnsafeUnpin for GeoHash
impl UnwindSafe for GeoHash
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