Enum google_maps::directions::error::Error
source · pub enum Error {
Show 28 variants
ArrivalTimeIsForTransitOnly(String, String),
EitherAlternativesOrWaypoints(usize),
EitherDepartureTimeOrArrivalTime(String, String),
EitherRestrictionsOrWaypoints(usize, String),
EitherWaypointsOrTransitMode(usize),
GoogleMapsService(Status, Option<String>),
HttpUnsuccessful(String),
InvalidAvoidCode(String),
InvalidCurrencyCode(String),
InvalidGeocoderStatusCode(String),
InvalidDrivingManeuverCode(String),
InvalidStatusCode(String),
InvalidTimeZoneName(String),
InvalidTrafficModelCode(String),
InvalidTransitModeCode(String),
InvalidTransitRoutePreferenceCode(String),
InvalidTravelModeCode(String),
InvalidUnitSystemCode(String),
InvalidVehicleTypeCode(String),
InvalidDepartureTime(String),
QueryNotBuilt,
RequestNotValidated,
Reqwest(Error),
ReqwestMessage(String),
SerdeJson(Error),
TooManyWaypoints(usize),
TransitModeIsForTransitOnly(String, String),
TransitRoutePreferenceIsForTransitOnly(String, String),
}
Expand description
Errors that may be produced by the Google Maps Directions API client.
Variants§
ArrivalTimeIsForTransitOnly(String, String)
An arrival time may only be specified in Transit travel mode.
EitherAlternativesOrWaypoints(usize)
Alternatives may not be requested when waypoints are specified.
EitherDepartureTimeOrArrivalTime(String, String)
An departure time may not be specified when an arrival time is specified.
EitherRestrictionsOrWaypoints(usize, String)
Restrictions may not be specified when waypoints are specified.
EitherWaypointsOrTransitMode(usize)
Waypoints may not be specified in Transit travel mode.
GoogleMapsService(Status, Option<String>)
Google Maps Directions API service generated an error. See the Status
enum for more information.
HttpUnsuccessful(String)
The HTTP request was unsuccessful.
InvalidAvoidCode(String)
API client library attempted to parse a string that contained an invalid
avoid/restrictions code. See
google_maps\src\directions\request\avoid.rs
for more information.
InvalidCurrencyCode(String)
API client library attempted to parse a string that contained an invalid
currency code. See
google_maps\src\directions\response\currency.rs
for more information.
InvalidGeocoderStatusCode(String)
API client library attempted to parse a string that contained an invalid
geocoder status code. See
google_maps\src\directions\response\geocoder_status.rs
for more
information.
InvalidDrivingManeuverCode(String)
API client library attempted to parse a string that contained an invalid
maneuver type code. See
google_maps\src\directions\response\maneuver_type.rs
for more
information.
InvalidStatusCode(String)
API client library attempted to parse a string that contained an invalid
status code. See google_maps\src\directions\response\status.rs
for
more information.
InvalidTimeZoneName(String)
API client library attempted to parse a string that contained an invalid
time zone name. See
google_maps\src\directions\response\time_zone.rs
for more information.
InvalidTrafficModelCode(String)
API client library attempted to parse a string that contained an invalid
traffic model code. See
google_maps\src\directions\request\traffic_model.rs
for more
information.
InvalidTransitModeCode(String)
API client library attempted to parse a string that contained an invalid
transit mode code. See
google_maps\src\directions\request\transit_mode.rs
for more
information.
InvalidTransitRoutePreferenceCode(String)
API client library attempted to parse a string that contained an invalid
transit routing preference code. See
google_maps\src\directions\request\transit_route_preference.rs
for
more information.
InvalidTravelModeCode(String)
API client library attempted to parse a string that contained an invalid
travel mode code. See google_maps\src\directions\travel_mode.rs
for
more information.
InvalidUnitSystemCode(String)
API client library attempted to parse a string that contained an invalid
unit system code. See
google_maps\src\directions\request\unit_system.rs
for more
information.
InvalidVehicleTypeCode(String)
API client library attempted to parse a string that contained an invalid
vehicle type code. See google_maps\src\directions\vehicle_type.rs
for
more information.
InvalidDepartureTime(String)
API client library attempted to parse a string that contained an invalid
departure time. See
google_maps\src\directions\request\departure_time.rs
for more
information.
QueryNotBuilt
The query string must be built before the request may be sent to the Google Maps Directions API service.
RequestNotValidated
The request must be validated before a query string may be built.
Reqwest(Error)
The dependency library Reqwest generated an error.
ReqwestMessage(String)
The dependency library Reqwest generated an error. The error could
not be passed normally so a String
representation is passed instead.
SerdeJson(Error)
The dependency library Serde JSON generated an error.
TooManyWaypoints(usize)
Too many waypoints specified.
TransitModeIsForTransitOnly(String, String)
Transit mode may only be specified in Transit travel mode.
TransitRoutePreferenceIsForTransitOnly(String, String)
Transit routing preference may only be specified in Transit travel mode.
Trait Implementations§
source§impl Diagnostic for Error
impl Diagnostic for Error
source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine.source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
.source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moresource§fn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue?source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic
’s Diagnostic::source_code
Diagnostic
s.