[][src]Enum google_maps::directions::request::location::Location

pub enum Location {
    Address(String),
    LatLng {
        lat: f32,
        lng: f32,
    },
    PlaceId(String),
}

Used to specify the address, latitude/longitude, or place ID for the origin and destination.

Variants

Address(String)

If you pass an address, the Directions service geocodes the string and converts it to a latitude/longitude coordinate 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

If you pass coordinates, they are used unchanged to calculate directions.

Fields of LatLng

lat: f32

Latitude

lng: f32

Longitude

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.

Trait Implementations

impl Clone for Location[src]

impl Debug for Location[src]

impl<'_> From<&'_ Location> for String[src]

fn from(location: &Location) -> String[src]

Converts a Location enum to a String that contains a URL-encoded location value.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,