[][src]Enum google_maps::UnitSystem

pub enum UnitSystem {
    Imperial,
    Metric,
}

Specifies the unit system to use when displaying results.

Directions results contain text within distance fields that may be displayed to the user to indicate the distance of a particular "step" of the route. By default, this text uses the unit system of the origin's country or region.

For example, a route from "Chicago, IL" to "Toronto, ONT" will display results in miles, while the reverse route will display results in kilometers. You may override this unit system by setting one explicitly within the request's units parameter, passing one of the following values:

Note: this unit system setting only affects the text displayed within distance fields. The distance fields also contain values which are always expressed in meters.

Variants

Imperial

Specifies that distances in the response should be expressed in imperial units, miles and feet.

Metric

Specifies that distances in the response should be expressed in metric units, using kilometres and metres.

Trait Implementations

impl Clone for UnitSystem[src]

impl Debug for UnitSystem[src]

impl Default for UnitSystem[src]

fn default() -> Self[src]

Returns a reasonable default variant for the UnitSystem enum type.

impl<'de> Deserialize<'de> for UnitSystem[src]

impl Display for UnitSystem[src]

fn fmt(&self, f: &mut Formatter) -> Result[src]

Formats a UnitSystem enum into a string that is presentable to the end user.

impl Eq for UnitSystem[src]

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

fn from(units: &UnitSystem) -> String[src]

Converts a UnitSystem enum to a String that contains a unit system code.

impl Hash for UnitSystem[src]

impl Ord for UnitSystem[src]

impl PartialEq<UnitSystem> for UnitSystem[src]

impl PartialOrd<UnitSystem> for UnitSystem[src]

impl Serialize for UnitSystem[src]

impl StructuralEq for UnitSystem[src]

impl StructuralPartialEq for UnitSystem[src]

impl TryFrom<String> for UnitSystem[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_from(units: String) -> Result<UnitSystem, Error>[src]

Gets a UnitSystem enum from a String that contains a valid unit system code.

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?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> ToString for T where
    T: Display + ?Sized
[src]

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>,