Enum google_maps::directions::request::traffic_model::TrafficModel [−][src]
pub enum TrafficModel { BestGuess, Optimistic, Pessimistic, }
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
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.
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.
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Converts a TrafficModel
enum to a String
that contains a traffic
model
code.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Gets a TrafficModel
enum from a String
that contains a valid
traffic
model
code.
Auto Trait Implementations
impl RefUnwindSafe for TrafficModel
impl Send for TrafficModel
impl Sync for TrafficModel
impl Unpin for TrafficModel
impl UnwindSafe for TrafficModel
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more