Enum google_maps::directions::travel_mode::TravelMode
source · #[repr(u8)]pub enum TravelMode {
Driving = 0,
Walking = 1,
Bicycling = 2,
Transit = 3,
}
Expand description
Specifies the mode of transportation.
When you calculate directions, you may specify the transportation mode
to
use. By default, directions are calculated as driving
directions.
Note: Both walking and bicycling directions may sometimes not include
clear pedestrian or bicycling paths, so these directions will return
warnings
in the returned result which you must display to the user.
Variants§
Driving = 0
(Default) Indicates standard driving directions using the road network.
Walking = 1
Requests walking directions via pedestrian paths & sidewalks (where available).
Bicycling = 2
Requests bicycling directions via bicycle paths & preferred streets (where available).
Transit = 3
Requests directions via public transit routes (where available). If you
set the mode to transit
, you can optionally specify either a
departure_time
or an arrival_time
. If neither time is specified, the
departure_time
defaults to now (that is, the departure time defaults
to the current time). You can also optionally include a transit_mode
and/or a transit_routing_preference
.
Implementations§
Trait Implementations§
source§impl Clone for TravelMode
impl Clone for TravelMode
source§fn clone(&self) -> TravelMode
fn clone(&self) -> TravelMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TravelMode
impl Debug for TravelMode
source§impl Default for TravelMode
impl Default for TravelMode
source§fn default() -> TravelMode
fn default() -> TravelMode
source§impl<'de> Deserialize<'de> for TravelMode
impl<'de> Deserialize<'de> for TravelMode
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 TravelMode
impl Display for TravelMode
source§impl From<&TravelMode> for &str
impl From<&TravelMode> for &str
source§fn from(travel_mode: &TravelMode) -> Self
fn from(travel_mode: &TravelMode) -> Self
Converts a TravelMode
enum to a String
that contains a travel
mode
code.
source§impl From<&TravelMode> for String
impl From<&TravelMode> for String
source§fn from(travel_mode: &TravelMode) -> Self
fn from(travel_mode: &TravelMode) -> Self
Converts a TravelMode
enum to a String
that contains a travel
mode
code.
source§impl FromStr for TravelMode
impl FromStr for TravelMode
source§impl Hash for TravelMode
impl Hash for TravelMode
source§impl Ord for TravelMode
impl Ord for TravelMode
source§fn cmp(&self, other: &TravelMode) -> Ordering
fn cmp(&self, other: &TravelMode) -> 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 TravelMode
impl PartialEq for TravelMode
source§fn eq(&self, other: &TravelMode) -> bool
fn eq(&self, other: &TravelMode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TravelMode
impl PartialOrd for TravelMode
source§fn partial_cmp(&self, other: &TravelMode) -> Option<Ordering>
fn partial_cmp(&self, other: &TravelMode) -> Option<Ordering>
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 moresource§impl Serialize for TravelMode
impl Serialize for TravelMode
source§impl TryFrom<&str> for TravelMode
impl TryFrom<&str> for TravelMode
impl Eq for TravelMode
impl StructuralPartialEq for TravelMode
Auto Trait Implementations§
impl RefUnwindSafe for TravelMode
impl Send for TravelMode
impl Sync for TravelMode
impl Unpin for TravelMode
impl UnwindSafe for TravelMode
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.