pub struct SavedPlace {
pub poi_id: String,
pub name: String,
pub address: String,
pub location: LatLng,
pub label: String,
pub city: String,
pub city_id: String,
pub country: String,
pub country_code: String,
}Expand description
One saved place, as returned by the favorites endpoint.
Fields§
§poi_id: String§name: StringThe place name (building / POI name).
address: String§location: LatLng§label: StringRaw label: HOME_TAG_PRESET, WORK_TAG_PRESET, a custom label, or
empty.
city: String§city_id: String§country: String§country_code: StringImplementations§
Source§impl SavedPlace
impl SavedPlace
Sourcepub fn display_label(&self) -> Option<String>
pub fn display_label(&self) -> Option<String>
The label as the app shows it: Home / Work for the presets, the
custom label otherwise, None if unlabeled.
Sourcepub fn formatted_address(&self) -> String
pub fn formatted_address(&self) -> String
name - address, the line the web app shows and stores.
Sourcepub fn matches(&self, loc: &Location) -> bool
pub fn matches(&self, loc: &Location) -> bool
Whether this is the place the saved delivery address points at: same poiID, or (failing that) practically the same coordinates.
Sourcepub fn distance_m(&self, loc: &Location) -> f64
pub fn distance_m(&self, loc: &Location) -> f64
Great-circle distance to the saved delivery address, in metres.
Trait Implementations§
Source§impl Clone for SavedPlace
impl Clone for SavedPlace
Source§impl Debug for SavedPlace
impl Debug for SavedPlace
Source§impl<'de> Deserialize<'de> for SavedPlace
impl<'de> Deserialize<'de> for SavedPlace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for SavedPlace
impl Freeze for SavedPlace
impl RefUnwindSafe for SavedPlace
impl Send for SavedPlace
impl Sync for SavedPlace
impl Unpin for SavedPlace
impl UnsafeUnpin for SavedPlace
impl UnwindSafe for SavedPlace
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
Mutably borrows from an owned value. Read more