#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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 Car use the CarModeOptions parameter.

  • If traveling by Truck use the TruckModeOptions parameter.

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

source

pub fn calculator_name(&self) -> Option<&str>

The name of the route calculator resource that you want to use to calculate the route matrix.

source

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().

source

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().

source

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 Car use the CarModeOptions parameter.

  • If traveling by Truck use the TruckModeOptions parameter.

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

source

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

source

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

source

pub fn distance_unit(&self) -> Option<&DistanceUnit>

Set the unit system to specify the distance.

Default Value: Kilometers

source

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.

source

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

pub fn key(&self) -> Option<&str>

The optional API key to authorize the request.

source§

impl CalculateRouteMatrixInput

source

pub fn builder() -> CalculateRouteMatrixInputBuilder

Creates a new builder-style object to manufacture CalculateRouteMatrixInput.

Trait Implementations§

source§

impl Clone for CalculateRouteMatrixInput

source§

fn clone(&self) -> CalculateRouteMatrixInput

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CalculateRouteMatrixInput

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for CalculateRouteMatrixInput

source§

fn eq(&self, other: &CalculateRouteMatrixInput) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for CalculateRouteMatrixInput

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more