Enum google_maps::directions::request::transit_mode::TransitMode
source · #[repr(u8)]pub enum TransitMode {
Bus = 0,
Rail = 1,
Subway = 2,
Train = 3,
Tram = 4,
}
Expand description
Specifies one or more preferred modes of transit.
This parameter may only be specified for transit directions, and only if the request includes an API key or a Google Maps Platform Premium Plan client ID.
Variants§
Bus = 0
Indicates that the calculated route should prefer travel by bus.
Rail = 1
Indicates that the calculated route should prefer travel by train, tram,
light rail, and subway. This is equivalent to
transit_mode=train|tram|subway
.
Subway = 2
Indicates that the calculated route should prefer travel by subway.
Train = 3
Indicates that the calculated route should prefer travel by train.
Tram = 4
Indicates that the calculated route should prefer travel by tram and light rail. Indicates that the calculated route should prefer travel by tram and light rail.
Implementations§
Trait Implementations§
source§impl Clone for TransitMode
impl Clone for TransitMode
source§fn clone(&self) -> TransitMode
fn clone(&self) -> TransitMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TransitMode
impl Debug for TransitMode
source§impl Default for TransitMode
impl Default for TransitMode
source§fn default() -> TransitMode
fn default() -> TransitMode
source§impl<'de> Deserialize<'de> for TransitMode
impl<'de> Deserialize<'de> for TransitMode
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 TransitMode
impl Display for TransitMode
source§impl From<&TransitMode> for &str
impl From<&TransitMode> for &str
source§fn from(transit_mode: &TransitMode) -> Self
fn from(transit_mode: &TransitMode) -> Self
Converts a TransitMode
enum to a String
that contains a transit
mode
code.
source§impl From<&TransitMode> for String
impl From<&TransitMode> for String
source§fn from(transit_mode: &TransitMode) -> Self
fn from(transit_mode: &TransitMode) -> Self
Converts a TransitMode
enum to a String
that contains a transit
mode
code.
source§impl From<&TransitMode> for TransitMode
impl From<&TransitMode> for TransitMode
source§impl FromStr for TransitMode
impl FromStr for TransitMode
source§impl Hash for TransitMode
impl Hash for TransitMode
source§impl Ord for TransitMode
impl Ord for TransitMode
source§fn cmp(&self, other: &TransitMode) -> Ordering
fn cmp(&self, other: &TransitMode) -> 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 TransitMode
impl PartialEq for TransitMode
source§fn eq(&self, other: &TransitMode) -> bool
fn eq(&self, other: &TransitMode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TransitMode
impl PartialOrd for TransitMode
source§fn partial_cmp(&self, other: &TransitMode) -> Option<Ordering>
fn partial_cmp(&self, other: &TransitMode) -> 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 more