pub enum Waypoint {
Address(String),
LatLng(LatLng),
PlaceId(String),
Polyline(String),
}Expand description
Used to specify pass throughs or stopovers at intermediate locations.
Variants§
Address(String)
If you pass an address, the Directions service geocodes the string and converts it to latitude & longitude coordinates to calculate directions. This coordinate may be different from that returned by the Geocoding API, for example a building entrance rather than its center.
LatLng(LatLng)
If you pass coordinates, they are used unchanged to calculate directions.
PlaceId(String)
The place ID may only be specified if the request includes an API key or a Google Maps Platform Premium Plan client ID. You can retrieve place IDs from the Geocoding API and the Places API (including Place Autocomplete). For an example using place IDs from Place Autocomplete, see Place Autocomplete and Directions. For more about place IDs, see the Place ID overview.
Polyline(String)
Alternatively, you can supply an encoded set of points using the Encoded Polyline Algorithm. You will find an encoded set is useful for a large number of waypoints, because the URL is significantly shorter. All web services have a URL limit of 8192 characters.
See also: the Google Encoded Polyline encoding & decoding crate called polyline.
Implementations§
Source§impl Waypoint
impl Waypoint
Sourcepub fn from_address(address: impl Into<String>) -> Self
pub fn from_address(address: impl Into<String>) -> Self
If you pass an address, the Directions service geocodes the string and converts it to latitude & longitude coordinates to calculate directions. This coordinate may be different from that returned by the Geocoding API, for example a building entrance rather than its center.
Source§impl Waypoint
impl Waypoint
Sourcepub fn from_place_id(place_id: impl Into<String>) -> Self
pub fn from_place_id(place_id: impl Into<String>) -> Self
The place ID may only be specified if the request includes an API key or a Google Maps Platform Premium Plan client ID. You can retrieve place IDs from the Geocoding API and the Places API (including Place Autocomplete). For an example using place IDs from Place Autocomplete, see Place Autocomplete and Directions. For more about place IDs, see the Place ID overview.
Source§impl Waypoint
impl Waypoint
Sourcepub fn from_polyline(polyline: impl Into<String>) -> Self
pub fn from_polyline(polyline: impl Into<String>) -> Self
Alternatively, you can supply an encoded set of points using the Encoded Polyline Algorithm. You will find an encoded set is useful for a large number of waypoints, because the URL is significantly shorter. All web services have a URL limit of 8192 characters.
See also: the Google Encoded Polyline encoding & decoding crate called polyline.
Source§impl Waypoint
impl Waypoint
Sourcepub fn try_from_dec(
latitude: Decimal,
longitude: Decimal,
) -> Result<Self, GoogleMapsError>
pub fn try_from_dec( latitude: Decimal, longitude: Decimal, ) -> Result<Self, GoogleMapsError>
Takes individual latitude & longitude Decimal coordinates and
converts them into a Waypoint structure. If either the latitude
(-90.0 to +90.0) or longitude (-180.0 to +180.0) are out of range, this
function will return an error.
Source§impl Waypoint
impl Waypoint
Sourcepub fn try_from_f32(
latitude: f32,
longitude: f32,
) -> Result<Self, GoogleMapsError>
pub fn try_from_f32( latitude: f32, longitude: f32, ) -> Result<Self, GoogleMapsError>
Takes individual latitude & longitude f32 coordinates and
converts them into a Waypoint structure. If either the latitude
(-90.0 to +90.0) or longitude (-180.0 to +180.0) are out of range, this
function will return an error.
Source§impl Waypoint
impl Waypoint
Sourcepub fn try_from_f64(
latitude: f64,
longitude: f64,
) -> Result<Self, GoogleMapsError>
pub fn try_from_f64( latitude: f64, longitude: f64, ) -> Result<Self, GoogleMapsError>
Takes individual latitude & longitude f64 coordinates and
converts them into a Waypoint structure. If either the latitude
(-90.0 to +90.0) or longitude (-180.0 to +180.0) are out of range, this
function will return an error.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Waypoint
impl<'de> Deserialize<'de> for Waypoint
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 Waypoint
impl Ord for Waypoint
Source§impl PartialOrd for Waypoint
impl PartialOrd for Waypoint
impl Eq for Waypoint
impl StructuralPartialEq for Waypoint
Auto Trait Implementations§
impl Freeze for Waypoint
impl RefUnwindSafe for Waypoint
impl Send for Waypoint
impl Sync for Waypoint
impl Unpin for Waypoint
impl UnwindSafe for Waypoint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.