#[repr(u8)]pub enum TrafficModel {
BestGuess = 0,
Optimistic = 1,
Pessimistic = 2,
}Expand description
Specifies the traffic model to use when calculating time in traffic.
This setting affects the value returned in the duration_in_traffic field
in the response, which contains the predicted time in traffic based on
historical averages. The traffic_model parameter may only be specified for
driving directions where the request includes a departure_time, and only
if the request includes an API key or a Google Maps Platform Premium Plan
client ID.
The default value of best_guess will give the most useful predictions for
the vast majority of use cases. It is possible the best_guess travel time
prediction may be shorter than optimistic, or alternatively, longer
than pessimistic, due to the way the best_guess prediction model
integrates live traffic information.
Variants§
BestGuess = 0
Indicates that the returned duration_in_traffic 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.
Optimistic = 1
Indicates that the returned duration_in_traffic 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.
Pessimistic = 2
Indicates that the returned duration_in_traffic should be longer than
the actual travel time on most days, though occasional days with
particularly bad traffic conditions may exceed this value.
Implementations§
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<'de> Deserialize<'de> for TrafficModel
impl<'de> Deserialize<'de> for TrafficModel
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 TrafficModel
impl Display for TrafficModel
Source§impl From<&TrafficModel> for &str
impl From<&TrafficModel> for &str
Source§fn from(traffic_model: &TrafficModel) -> Self
fn from(traffic_model: &TrafficModel) -> Self
Converts a TrafficModel enum to a String that contains a traffic
model
code.
Source§impl From<&TrafficModel> for String
impl From<&TrafficModel> for String
Source§fn from(traffic_model: &TrafficModel) -> Self
fn from(traffic_model: &TrafficModel) -> Self
Converts a TrafficModel enum to a String that contains a traffic
model
code.
Source§impl FromStr for TrafficModel
impl FromStr for TrafficModel
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§impl PartialOrd for TrafficModel
impl PartialOrd for TrafficModel
Source§impl Serialize for TrafficModel
impl Serialize for TrafficModel
Source§impl TryFrom<&str> for TrafficModel
impl TryFrom<&str> 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
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.