#[non_exhaustive]pub struct CalculateRouteMatrixInput {
pub calculator_name: Option<String>,
pub departure_positions: Option<Vec<Vec<f64>>>,
pub destination_positions: Option<Vec<Vec<f64>>>,
pub travel_mode: Option<TravelMode>,
pub departure_time: Option<DateTime>,
pub depart_now: Option<bool>,
pub distance_unit: Option<DistanceUnit>,
pub car_mode_options: Option<CalculateRouteCarModeOptions>,
pub truck_mode_options: Option<CalculateRouteTruckModeOptions>,
pub key: Option<String>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.calculator_name: Option<String>The name of the route calculator resource that you want to use to calculate the route matrix.
departure_positions: Option<Vec<Vec<f64>>>The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format: \[longitude, latitude\]. For example, \[-123.115, 49.285\].
Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.
For route calculators that use Esri as the data provider, if you specify a departure that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result in SnappedDeparturePositions.
Valid Values: \[-180 to 180,-90 to 90\]
destination_positions: Option<Vec<Vec<f64>>>The list of destination positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format: \[longitude, latitude\]. For example, \[-122.339, 47.615\]
Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.
For route calculators that use Esri as the data provider, if you specify a destination that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result in SnappedDestinationPositions.
Valid Values: \[-180 to 180,-90 to 90\]
travel_mode: Option<TravelMode>Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.
The TravelMode you specify also determines how you specify route preferences:
-
If traveling by
Caruse theCarModeOptionsparameter. -
If traveling by
Truckuse theTruckModeOptionsparameter.
Bicycle or Motorcycle are only valid when using Grab as a data provider, and only within Southeast Asia.
Truck is not available for Grab.
For more information about using Grab as a data provider, see GrabMaps in the Amazon Location Service Developer Guide.
Default Value: Car
departure_time: Option<DateTime>Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set both DepartureTime and DepartNow. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.
Setting a departure time in the past returns a 400 ValidationException error.
-
In ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ. For example,2020–07-2T12:15:20.000Z+01:00
depart_now: Option<bool>Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't set both DepartureTime and DepartNow. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.
Default Value: false
Valid Values: false | true
distance_unit: Option<DistanceUnit>Set the unit system to specify the distance.
Default Value: Kilometers
car_mode_options: Option<CalculateRouteCarModeOptions>Specifies route preferences when traveling by Car, such as avoiding routes that use ferries or tolls.
Requirements: TravelMode must be specified as Car.
truck_mode_options: Option<CalculateRouteTruckModeOptions>Specifies route preferences when traveling by Truck, such as avoiding routes that use ferries or tolls, and truck specifications to consider when choosing an optimal road.
Requirements: TravelMode must be specified as Truck.
key: Option<String>The optional API key to authorize the request.
Implementations§
source§impl CalculateRouteMatrixInput
impl CalculateRouteMatrixInput
sourcepub fn calculator_name(&self) -> Option<&str>
pub fn calculator_name(&self) -> Option<&str>
The name of the route calculator resource that you want to use to calculate the route matrix.
sourcepub fn departure_positions(&self) -> &[Vec<f64>]
pub fn departure_positions(&self) -> &[Vec<f64>]
The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format: \[longitude, latitude\]. For example, \[-123.115, 49.285\].
Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.
For route calculators that use Esri as the data provider, if you specify a departure that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result in SnappedDeparturePositions.
Valid Values: \[-180 to 180,-90 to 90\]
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .departure_positions.is_none().
sourcepub fn destination_positions(&self) -> &[Vec<f64>]
pub fn destination_positions(&self) -> &[Vec<f64>]
The list of destination positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format: \[longitude, latitude\]. For example, \[-122.339, 47.615\]
Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.
For route calculators that use Esri as the data provider, if you specify a destination that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result in SnappedDestinationPositions.
Valid Values: \[-180 to 180,-90 to 90\]
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .destination_positions.is_none().
sourcepub fn travel_mode(&self) -> Option<&TravelMode>
pub fn travel_mode(&self) -> Option<&TravelMode>
Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.
The TravelMode you specify also determines how you specify route preferences:
-
If traveling by
Caruse theCarModeOptionsparameter. -
If traveling by
Truckuse theTruckModeOptionsparameter.
Bicycle or Motorcycle are only valid when using Grab as a data provider, and only within Southeast Asia.
Truck is not available for Grab.
For more information about using Grab as a data provider, see GrabMaps in the Amazon Location Service Developer Guide.
Default Value: Car
sourcepub fn departure_time(&self) -> Option<&DateTime>
pub fn departure_time(&self) -> Option<&DateTime>
Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set both DepartureTime and DepartNow. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.
Setting a departure time in the past returns a 400 ValidationException error.
-
In ISO 8601 format:
YYYY-MM-DDThh:mm:ss.sssZ. For example,2020–07-2T12:15:20.000Z+01:00
sourcepub fn depart_now(&self) -> Option<bool>
pub fn depart_now(&self) -> Option<bool>
Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't set both DepartureTime and DepartNow. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.
Default Value: false
Valid Values: false | true
sourcepub fn distance_unit(&self) -> Option<&DistanceUnit>
pub fn distance_unit(&self) -> Option<&DistanceUnit>
Set the unit system to specify the distance.
Default Value: Kilometers
sourcepub fn car_mode_options(&self) -> Option<&CalculateRouteCarModeOptions>
pub fn car_mode_options(&self) -> Option<&CalculateRouteCarModeOptions>
Specifies route preferences when traveling by Car, such as avoiding routes that use ferries or tolls.
Requirements: TravelMode must be specified as Car.
sourcepub fn truck_mode_options(&self) -> Option<&CalculateRouteTruckModeOptions>
pub fn truck_mode_options(&self) -> Option<&CalculateRouteTruckModeOptions>
Specifies route preferences when traveling by Truck, such as avoiding routes that use ferries or tolls, and truck specifications to consider when choosing an optimal road.
Requirements: TravelMode must be specified as Truck.
source§impl CalculateRouteMatrixInput
impl CalculateRouteMatrixInput
sourcepub fn builder() -> CalculateRouteMatrixInputBuilder
pub fn builder() -> CalculateRouteMatrixInputBuilder
Creates a new builder-style object to manufacture CalculateRouteMatrixInput.
Trait Implementations§
source§impl Clone for CalculateRouteMatrixInput
impl Clone for CalculateRouteMatrixInput
source§fn clone(&self) -> CalculateRouteMatrixInput
fn clone(&self) -> CalculateRouteMatrixInput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CalculateRouteMatrixInput
impl Debug for CalculateRouteMatrixInput
source§impl PartialEq for CalculateRouteMatrixInput
impl PartialEq for CalculateRouteMatrixInput
source§fn eq(&self, other: &CalculateRouteMatrixInput) -> bool
fn eq(&self, other: &CalculateRouteMatrixInput) -> bool
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for CalculateRouteMatrixInput
Auto Trait Implementations§
impl Freeze for CalculateRouteMatrixInput
impl RefUnwindSafe for CalculateRouteMatrixInput
impl Send for CalculateRouteMatrixInput
impl Sync for CalculateRouteMatrixInput
impl Unpin for CalculateRouteMatrixInput
impl UnwindSafe for CalculateRouteMatrixInput
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more