Struct google_maps::Geometry
source · pub struct Geometry {
pub location: LatLng,
pub location_type: Option<LocationType>,
pub viewport: Bounds,
pub bounds: Option<Bounds>,
}
Expand description
Contains the geocoded latitude/longitude, recommended viewport for displaying the returned result, the bounding box, and other additional data.
Fields§
§location: LatLng
Contains the geocoded latitude, longitude value. For normal address lookups, this field is typically the most important.
location_type: Option<LocationType>
Stores additional data about the specified location.
viewport: Bounds
Contains the recommended viewport for displaying the returned result, specified as two latitude/longitude values defining the southwest and northeast corner of the viewport bounding box. Generally the viewport is used to frame a result when displaying it to a user.
bounds: Option<Bounds>
Stores the bounding box which can fully contain the returned result. Note that these bounds may not match the recommended viewport. (For example, San Francisco includes the Farallon islands, which are technically part of the city, but probably should not be returned in the viewport.)
Implementations§
source§impl Geometry
impl Geometry
sourcepub fn get_bounds_southwest_lat(&self) -> Option<Decimal>
pub fn get_bounds_southwest_lat(&self) -> Option<Decimal>
A helper function for destructuring the optional bounds
field. If
the bounds field is populated, this function will return the
south-west latitude. If the bounds field is empty, this function
will return None
.
let bounds_southwest_lat = geocoding.geometry.get_bounds_southwest_lng();
sourcepub fn get_bounds_southwest_lng(&self) -> Option<Decimal>
pub fn get_bounds_southwest_lng(&self) -> Option<Decimal>
A helper function for destructuring the optional bounds
field. If
the bounds field is populated, this function will return the
south-west latitude. If the bounds field is empty, this function
will return None
.
let bounds_southwest_lng = geocoding.geometry.get_bounds_southwest_lng();
sourcepub fn get_bounds_northeast_lat(&self) -> Option<Decimal>
pub fn get_bounds_northeast_lat(&self) -> Option<Decimal>
A helper function for destructuring the optional bounds
field. If
the bounds field is populated, this function will return the
north-east latitude. If the bounds field is empty, this function
will return None
.
let bounds_northeast_lat = geocoding.geometry.get_bounds_northeast_lng();
sourcepub fn get_bounds_northeast_lng(&self) -> Option<Decimal>
pub fn get_bounds_northeast_lng(&self) -> Option<Decimal>
A helper function for destructuring the optional bounds
field. If
the bounds field is populated, this function will return the
north-east latitude. If the bounds field is empty, this function
will return None
.
let bounds_northeast_lng = geocoding.geometry.get_bounds_northeast_lng();
Trait Implementations§
source§impl<'de> Deserialize<'de> for Geometry
impl<'de> Deserialize<'de> for Geometry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Ord for Geometry
impl Ord for Geometry
source§impl PartialEq for Geometry
impl PartialEq for Geometry
source§impl PartialOrd for Geometry
impl PartialOrd for Geometry
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Geometry
impl Eq for Geometry
impl StructuralEq for Geometry
impl StructuralPartialEq for Geometry
Auto Trait Implementations§
impl RefUnwindSafe for Geometry
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnwindSafe for Geometry
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.