1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
//! Resources (enums, structs) for processing the _Directions API_ response from //! the Google Maps Platform. Look in here for more information about the data //! returned from Google's server and how to parse it with your program. mod currency; mod geocoded_waypoint; mod geocoder_status; mod leg; mod maneuver_type; mod overview_polyline; mod polyline; mod route; mod step; mod time; mod time_zone; mod transit_agency; mod transit_details; mod transit_line; mod transit_stop; mod transit_vehicle; pub mod distance; pub mod duration; pub mod fare; pub mod status; use crate::directions::{ response::{ geocoded_waypoint::GeocodedWaypoint, route::Route, status::Status, }, travel_mode::TravelMode, }; use serde::Deserialize; /// Directions responses contain the following root elements. #[derive(Clone, Debug, PartialEq, PartialOrd, Deserialize)] pub struct Response { /// Contains an array of available travel modes. This field is returned when /// a request specifies a travel `mode` and gets no results. The array /// contains the available travel modes in the countries of the given set of /// waypoints. This field is not returned if one or more of the waypoints /// are `via:` waypoints. pub available_travel_modes: Option<Vec<TravelMode>>, /// When the status code is other than `OK`, there may be an additional /// `error_message` field within the Directions response object. This field /// contains more detailed information about the reasons behind the given /// status code. /// /// **Note**: This field is not guaranteed to be always present, and its /// content is subject to change. pub error_message: Option<String>, /// Contains an array with details about the geocoding of origin, /// destination and waypoints. See [Geocoded /// Waypoints](https://developers.google.com/maps/documentation/directions/intro#GeocodedWaypoints). pub geocoded_waypoints: Option<Vec<GeocodedWaypoint>>, /// Contains an array of routes from the origin to the destination. See /// [Routes](https://developers.google.com/maps/documentation/directions/intro#Routes). /// Routes consist of nested /// [Legs](https://developers.google.com/maps/documentation/directions/intro#Legs) /// and [Steps](https://developers.google.com/maps/documentation/directions/intro#Steps). pub routes: Vec<Route>, /// Contains metadata on the request. See [Status /// Codes](https://developers.google.com/maps/documentation/directions/intro#StatusCodes). pub status: Status, } // struct