#[repr(u8)]pub enum UnitSystem {
Imperial = 0,
Metric = 1,
}Expand description
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 = 0
Specifies that distances in the response should be expressed in imperial units, miles and feet.
Metric = 1
Specifies that distances in the response should be expressed in metric units, using kilometres and metres.
Implementations§
Trait Implementations§
Source§impl Clone for UnitSystem
impl Clone for UnitSystem
Source§fn clone(&self) -> UnitSystem
fn clone(&self) -> UnitSystem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UnitSystem
impl Debug for UnitSystem
Source§impl Default for UnitSystem
impl Default for UnitSystem
Source§fn default() -> UnitSystem
fn default() -> UnitSystem
Source§impl<'de> Deserialize<'de> for UnitSystem
impl<'de> Deserialize<'de> for UnitSystem
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Manual implementation of Deserialize for serde. This will take
advantage of the phf-powered TryFrom implementation for this type.
Source§impl Display for UnitSystem
impl Display for UnitSystem
Source§impl From<&UnitSystem> for &str
impl From<&UnitSystem> for &str
Source§fn from(units: &UnitSystem) -> Self
fn from(units: &UnitSystem) -> Self
Converts a UnitSystem enum to a String that contains a unit
system
code.
Source§impl From<&UnitSystem> for String
impl From<&UnitSystem> for String
Source§fn from(unit_system: &UnitSystem) -> Self
fn from(unit_system: &UnitSystem) -> Self
Converts a UnitSystem enum to a String that contains a unit
system
code.
Source§impl FromStr for UnitSystem
impl FromStr for UnitSystem
Source§impl Hash for UnitSystem
impl Hash for UnitSystem
Source§impl Ord for UnitSystem
impl Ord for UnitSystem
Source§fn cmp(&self, other: &UnitSystem) -> Ordering
fn cmp(&self, other: &UnitSystem) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for UnitSystem
impl PartialEq for UnitSystem
Source§impl PartialOrd for UnitSystem
impl PartialOrd for UnitSystem
Source§impl Serialize for UnitSystem
impl Serialize for UnitSystem
Source§impl TryFrom<&str> for UnitSystem
impl TryFrom<&str> for UnitSystem
impl Eq for UnitSystem
impl StructuralPartialEq for UnitSystem
Auto Trait Implementations§
impl Freeze for UnitSystem
impl RefUnwindSafe for UnitSystem
impl Send for UnitSystem
impl Sync for UnitSystem
impl Unpin for UnitSystem
impl UnwindSafe for UnitSystem
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.