google_maps/geocoding/forward/
with_place_id.rs

1impl crate::geocoding::ForwardRequest<'_> {
2    /// Specifies the place id to geocode.
3    ///
4    /// ## Arguments
5    ///
6    /// * `place_id` - `TThe` place ID of the place for which you wish to obtain
7    ///   the human-readable address. The place ID is a unique identifier that
8    ///   can be used with other Google APIs. For example, you can use the
9    ///   placeID returned by the [Roads
10    ///   API](https://developers.google.com/maps/documentation/roads/snap) to
11    ///   get the address for a snapped point.
12    ///   For more information about place IDs, see the place [ID
13    ///   overview](https://developers.google.com/maps/documentation/places/web-service/place-id).
14    ///
15    /// ## Example
16    ///
17    /// ```rust
18    /// .with_place_id(
19    ///     "ChIJd8BlQ2BZwokRAFUEcm_qrcA"
20    /// )
21    /// ```
22    #[must_use] pub fn with_place_id(
23        mut self,
24        place_id: impl Into<String>
25    ) -> Self {
26        // Set address in ForwardRequest struct.
27        self.place_id = Some(place_id.into());
28        // Return modified ForwardRequest struct to caller.
29        self
30    } // fn
31} // impl