Enum google_api_proto::google::maps::routing::v2::TrafficModel
source · #[repr(i32)]pub enum TrafficModel {
Unspecified = 0,
BestGuess = 1,
Pessimistic = 2,
Optimistic = 3,
}
Expand description
Specifies the assumptions to use when calculating time in traffic. This
setting affects the value returned in the duration
field in the
response, which contains the predicted time in traffic based on historical
averages.
Variants§
Unspecified = 0
Unused. If specified, will default to BEST_GUESS
.
BestGuess = 1
Indicates that the returned duration
should be the best
estimate of travel time given what is known about both historical traffic
conditions and live traffic. Live traffic becomes more important the closer
the departure_time
is to now.
Pessimistic = 2
Indicates that the returned duration should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value.
Optimistic = 3
Indicates that the returned duration should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value.
Implementations§
source§impl TrafficModel
impl TrafficModel
source§impl TrafficModel
impl TrafficModel
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for TrafficModel
impl Clone for TrafficModel
source§fn clone(&self) -> TrafficModel
fn clone(&self) -> TrafficModel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TrafficModel
impl Debug for TrafficModel
source§impl Default for TrafficModel
impl Default for TrafficModel
source§fn default() -> TrafficModel
fn default() -> TrafficModel
source§impl From<TrafficModel> for i32
impl From<TrafficModel> for i32
source§fn from(value: TrafficModel) -> i32
fn from(value: TrafficModel) -> i32
source§impl Hash for TrafficModel
impl Hash for TrafficModel
source§impl Ord for TrafficModel
impl Ord for TrafficModel
source§fn cmp(&self, other: &TrafficModel) -> Ordering
fn cmp(&self, other: &TrafficModel) -> 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 TrafficModel
impl PartialEq for TrafficModel
source§fn eq(&self, other: &TrafficModel) -> bool
fn eq(&self, other: &TrafficModel) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TrafficModel
impl PartialOrd for TrafficModel
source§fn partial_cmp(&self, other: &TrafficModel) -> Option<Ordering>
fn partial_cmp(&self, other: &TrafficModel) -> 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 TryFrom<i32> for TrafficModel
impl TryFrom<i32> for TrafficModel
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
source§fn try_from(value: i32) -> Result<TrafficModel, UnknownEnumValue>
fn try_from(value: i32) -> Result<TrafficModel, UnknownEnumValue>
impl Copy for TrafficModel
impl Eq for TrafficModel
impl StructuralPartialEq for TrafficModel
Auto Trait Implementations§
impl Freeze for TrafficModel
impl RefUnwindSafe for TrafficModel
impl Send for TrafficModel
impl Sync for TrafficModel
impl Unpin for TrafficModel
impl UnwindSafe for TrafficModel
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request