[][src]Struct google_maps::Step

pub struct Step {
    pub distance: DirectionsDistance,
    pub duration: DirectionsDuration,
    pub end_location: LatLng,
    pub html_instructions: String,
    pub maneuver: Option<DrivingManeuver>,
    pub polyline: Polyline,
    pub start_location: LatLng,
    pub steps: Option<Vec<Step>>,
    pub transit_details: Option<TransitDetails>,
    pub travel_mode: TravelMode,
}

Each element in the steps array defines a single step of the calculated directions. A step is the most atomic unit of a direction's route, containing a single step describing a specific, single instruction on the journey. E.g. "Turn left at W. 4th St." The step not only describes the instruction but also contains distance and duration information relating to how this step relates to the following step. For example, a step denoted as "Merge onto I-80 West" may contain a duration of "37 miles" and "40 minutes," indicating that the next step is 37 miles/40 minutes from this step.

When using the Directions API to search for transit directions, the steps array will include additional transit details in the form of a transit_details array. If the directions include multiple modes of transportation, detailed directions will be provided for walking or driving steps in an inner steps array. For example, a walking step will include directions from the start and end locations: "Walk to Innes Ave & Fitch St". That step will include detailed walking directions for that route in the inner steps array, such as: "Head north-west", "Turn left onto Arelious Walker", and "Turn left onto Innes Ave".

Fields

distance: DirectionsDistance

The distance covered by this step. This property may be undefined as the distance may be unknown.

duration: DirectionsDuration

The typical time required to perform this step in seconds and in text form. This property may be undefined as the duration may be unknown.

end_location: LatLng

The ending location of this step.

html_instructions: String

Instructions for this step.

maneuver: Option<DrivingManeuver>

Contains the action to take for the current step (turn left, merge, straight, etc.). This field is used to determine which icon to display.

polyline: Polyline

Contains a single points object that holds an encoded polyline representation of the step. This polyline is an approximate (smoothed) path of the step. (Corresponds to path in the Directions.Step interface.)

start_location: LatLng

The starting location of this step.

steps: Option<Vec<Step>>

Contains detailed directions for walking or driving steps in transit directions. Substeps are only available when travel_mode is set to "transit". The inner steps array is of the same type as steps.

transit_details: Option<TransitDetails>

Transit-specific details about this step. This property will be undefined unless the travel mode of this step is TravelMode::Transit.

travel_mode: TravelMode

The mode of travel used in this step.

Methods

impl Step[src]

pub fn get_maneuver(&self) -> Option<String>[src]

A helper function for destructuring (or serializing) the optional maneuver field. If the ManeuverType enum in the step is populated, this function will return it as a String. If the ManeuverType enum is empty, this function will return None.

let maneuver = step.get_maneuver();

Trait Implementations

impl Clone for Step[src]

impl Debug for Step[src]

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

impl PartialEq<Step> for Step[src]

impl StructuralPartialEq for Step[src]

Auto Trait Implementations

impl RefUnwindSafe for Step

impl Send for Step

impl Sync for Step

impl Unpin for Step

impl UnwindSafe for Step

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