pub struct Leg {Show 25 fields
pub mode: Mode,
pub from: Box<Place>,
pub to: Box<Place>,
pub duration: i32,
pub start_time: String,
pub end_time: String,
pub scheduled_start_time: String,
pub scheduled_end_time: String,
pub real_time: bool,
pub distance: Option<f64>,
pub interline_with_previous_leg: Option<bool>,
pub headsign: Option<String>,
pub route_color: Option<String>,
pub route_text_color: Option<String>,
pub route_type: Option<String>,
pub agency_name: Option<String>,
pub agency_url: Option<String>,
pub agency_id: Option<String>,
pub trip_id: Option<String>,
pub route_short_name: Option<String>,
pub source: Option<String>,
pub intermediate_stops: Option<Vec<Place>>,
pub leg_geometry: Box<EncodedPolyline>,
pub steps: Option<Vec<StepInstruction>>,
pub rental: Option<Box<Rental>>,
}
Fields§
§mode: Mode
Transport mode for this leg
from: Box<Place>
§to: Box<Place>
§duration: i32
Leg duration in seconds If leg is footpath: The footpath duration is derived from the default footpath duration using the query parameters transferTimeFactor
and additionalTransferTime
as follows: leg.duration = defaultDuration * transferTimeFactor + additionalTransferTime.
In case the defaultDuration is needed, it can be calculated by defaultDuration = (leg.duration - additionalTransferTime) / transferTimeFactor
. Note that the default values are transferTimeFactor = 1
and additionalTransferTime = 0
in case they are not explicitly provided in the query.
start_time: String
leg departure time
end_time: String
leg arrival time
scheduled_start_time: String
scheduled leg departure time
scheduled_end_time: String
scheduled leg arrival time
real_time: bool
Whether there is real-time data about this leg
distance: Option<f64>
For non-transit legs the distance traveled while traversing this leg in meters.
interline_with_previous_leg: Option<bool>
For transit legs, if the rider should stay on the vehicle as it changes route names.
headsign: Option<String>
For transit legs, the headsign of the bus or train being used. For non-transit legs, null
route_color: Option<String>
§route_text_color: Option<String>
§route_type: Option<String>
§agency_name: Option<String>
§agency_url: Option<String>
§agency_id: Option<String>
§trip_id: Option<String>
§route_short_name: Option<String>
§source: Option<String>
Filename and line number where this trip is from
intermediate_stops: Option<Vec<Place>>
For transit legs, intermediate stops between the Place where the leg originates and the Place where the leg ends. For non-transit legs, null.
leg_geometry: Box<EncodedPolyline>
§steps: Option<Vec<StepInstruction>>
A series of turn by turn instructions used for walking, biking and driving.
rental: Option<Box<Rental>>