[][src]Enum google_maps::directions::request::traffic_model::TrafficModel

pub enum TrafficModel {
    BestGuess,
    Optimistic,
    Pessimistic,
}

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

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

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

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.

Trait Implementations

impl Clone for TrafficModel[src]

impl Debug for TrafficModel[src]

impl Default for TrafficModel[src]

fn default() -> Self[src]

Returns a reasonable default variant for the TrafficModel enum type.

impl<'de> Deserialize<'de> for TrafficModel[src]

impl Display for TrafficModel[src]

fn fmt(&self, f: &mut Formatter) -> Result[src]

Formats a TrafficModel enum into a string that is presentable to the end user.

impl Eq for TrafficModel[src]

impl<'_> From<&'_ TrafficModel> for String[src]

fn from(traffic_model: &TrafficModel) -> String[src]

Converts a TrafficModel enum to a String that contains a traffic model code.

impl Hash for TrafficModel[src]

impl Ord for TrafficModel[src]

impl PartialEq<TrafficModel> for TrafficModel[src]

impl PartialOrd<TrafficModel> for TrafficModel[src]

impl Serialize for TrafficModel[src]

impl StructuralEq for TrafficModel[src]

impl StructuralPartialEq for TrafficModel[src]

impl<'_> TryFrom<&'_ str> for TrafficModel[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_from(traffic_model: &str) -> Result<TrafficModel, Error>[src]

Gets a TrafficModel enum from a String that contains a valid traffic model code.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,