[][src]Enum google_maps::directions::request::departure_time::DepartureTime

pub enum DepartureTime {
    Now,
    At(PrimitiveDateTime),
}

Specifies the desired time of departure.

You can specify the time or alternatively you can specify a value of now, which sets the departure time to the current time (correct to the nearest second).

  • For requests where the travel mode is transit: You can optionally specify one of departure_time or arrival_time. If neither time is specified, the departure_time defaults to now (that is, the departure time defaults to the current time).

  • For requests where the travel mode is driving: You can specify the departure_time to receive a route and trip duration (response field: duration_in_traffic) that take traffic conditions into account. This option is only available if the request contains a valid API key, or a valid Google Maps Platform Premium Plan client ID and signature. The departure_time must be set to the current time or some time in the future. It cannot be in the past.

Note: If departure time is not specified, choice of route and duration are based on road network and average time-independent traffic conditions. Results for a given request may vary over time due to changes in the road network, updated average traffic conditions, and the distributed nature of the service. Results may also vary between nearly-equivalent routes at any time or frequency.

Variants

Now

You can specify a value of now, which sets the departure time to the current time (correct to the nearest second).

Specifies the desired time of departure.

Trait Implementations

impl Clone for DepartureTime[src]

impl Debug for DepartureTime[src]

impl Default for DepartureTime[src]

fn default() -> Self[src]

Returns a reasonable default variant for the DepartureTime enum type.

impl Display for DepartureTime[src]

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

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

impl Eq for DepartureTime[src]

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

fn from(departure_time: &DepartureTime) -> String[src]

Converts a DepartureTime enum to a String that contains a departure time.

impl Hash for DepartureTime[src]

impl Ord for DepartureTime[src]

impl PartialEq<DepartureTime> for DepartureTime[src]

impl PartialOrd<DepartureTime> for DepartureTime[src]

impl StructuralEq for DepartureTime[src]

impl StructuralPartialEq for DepartureTime[src]

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<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.