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
impl crate::distance_matrix::Request<'_> {
/// Specifies the preference for transit routes.
///
/// ## Arguments
///
/// * `transit_route_preference` ‧ The preference of the transit rider;
/// should the directions service try to reduce the amount of _walking_ to
/// reach the destination, or reduce the number of bus _transfers_?
///
/// ## Description
///
/// Specifies preferences for transit routes. Using this parameter, you can
/// bias the options returned, rather than accepting the default best route
/// chosen by the API. This parameter may only be specified for transit
/// directions, and only if the request includes an API key or a Google Maps
/// Platform Premium Plan client ID. The parameter supports the following
/// arguments:
///
/// * `TransitRoutePreference::LessWalking` indicates that the calculated
/// route should prefer limited amounts of walking.
///
/// * `TransitRoutePreference::FewerTransfers` indicates that the
/// calculated route should prefer a limited number of transfers.
///
/// ## Example
///
/// * Set transit route preference to fewer transfers:
/// ```rust
/// .with_transit_route_preference(TransitRoutePreference::FewerTransfers)
/// ```
#[must_use] pub fn with_transit_route_preference(
mut self,
transit_route_preference: impl Into<crate::directions::TransitRoutePreference>
) -> Self {
self.transit_route_preference = Some(transit_route_preference.into());
self
} // fn
} // impl