Struct google_maps::types::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 more