#[non_exhaustive]pub struct Place {Show 17 fields
pub label: Option<String>,
pub geometry: Option<PlaceGeometry>,
pub address_number: Option<String>,
pub street: Option<String>,
pub neighborhood: Option<String>,
pub municipality: Option<String>,
pub sub_region: Option<String>,
pub region: Option<String>,
pub country: Option<String>,
pub postal_code: Option<String>,
pub interpolated: Option<bool>,
pub time_zone: Option<TimeZone>,
pub unit_type: Option<String>,
pub unit_number: Option<String>,
pub categories: Option<Vec<String>>,
pub supplemental_categories: Option<Vec<String>>,
pub sub_municipality: Option<String>,
}Expand description
Contains details about addresses or points of interest that match the search criteria.
Not all details are included with all responses. Some details may only be returned by specific data partners.
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.label: Option<String>The full name and address of the point of interest such as a city, region, or country. For example, 123 Any Street, Any Town, USA.
geometry: Option<PlaceGeometry>Places uses a point geometry to specify a location or a Place.
address_number: Option<String>The numerical portion of an address, such as a building number.
street: Option<String>The name for a street or a road to identify a location. For example, Main Street.
neighborhood: Option<String>The name of a community district. For example, Downtown.
municipality: Option<String>A name for a local area, such as a city or town name. For example, Toronto.
sub_region: Option<String>A county, or an area that's part of a larger region. For example, Metro Vancouver.
region: Option<String>A name for an area or geographical division, such as a province or state name. For example, British Columbia.
country: Option<String>A country/region specified using ISO 3166 3-digit country/region code. For example, CAN.
postal_code: Option<String>A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location.
interpolated: Option<bool>True if the result is interpolated from other known places.
False if the Place is a known place.
Not returned when the partner does not provide the information.
For example, returns False for an address location that is found in the partner data, but returns True if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses.
time_zone: Option<TimeZone>The time zone in which the Place is located. Returned only when using HERE or Grab as the selected partner.
unit_type: Option<String>For addresses with a UnitNumber, the type of unit. For example, Apartment.
Returned only for a place index that uses Esri as a data provider.
unit_number: Option<String>For addresses with multiple units, the unit identifier. Can include numbers and letters, for example 3B or Unit 123.
Returned only for a place index that uses Esri or Grab as a data provider. Is not returned for SearchPlaceIndexForPosition.
categories: Option<Vec<String>>The Amazon Location categories that describe this Place.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service developer guide.
supplemental_categories: Option<Vec<String>>Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories.
sub_municipality: Option<String>An area that's part of a larger municipality. For example, Blissville is a submunicipality in the Queen County in New York.
This property supported by Esri and OpenData. The Esri property is district, and the OpenData property is borough.
Implementations§
Source§impl Place
impl Place
Sourcepub fn label(&self) -> Option<&str>
pub fn label(&self) -> Option<&str>
The full name and address of the point of interest such as a city, region, or country. For example, 123 Any Street, Any Town, USA.
Sourcepub fn geometry(&self) -> Option<&PlaceGeometry>
pub fn geometry(&self) -> Option<&PlaceGeometry>
Places uses a point geometry to specify a location or a Place.
Sourcepub fn address_number(&self) -> Option<&str>
pub fn address_number(&self) -> Option<&str>
The numerical portion of an address, such as a building number.
Sourcepub fn street(&self) -> Option<&str>
pub fn street(&self) -> Option<&str>
The name for a street or a road to identify a location. For example, Main Street.
Sourcepub fn neighborhood(&self) -> Option<&str>
pub fn neighborhood(&self) -> Option<&str>
The name of a community district. For example, Downtown.
Sourcepub fn municipality(&self) -> Option<&str>
pub fn municipality(&self) -> Option<&str>
A name for a local area, such as a city or town name. For example, Toronto.
Sourcepub fn sub_region(&self) -> Option<&str>
pub fn sub_region(&self) -> Option<&str>
A county, or an area that's part of a larger region. For example, Metro Vancouver.
Sourcepub fn region(&self) -> Option<&str>
pub fn region(&self) -> Option<&str>
A name for an area or geographical division, such as a province or state name. For example, British Columbia.
Sourcepub fn country(&self) -> Option<&str>
pub fn country(&self) -> Option<&str>
A country/region specified using ISO 3166 3-digit country/region code. For example, CAN.
Sourcepub fn postal_code(&self) -> Option<&str>
pub fn postal_code(&self) -> Option<&str>
A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location.
Sourcepub fn interpolated(&self) -> Option<bool>
pub fn interpolated(&self) -> Option<bool>
True if the result is interpolated from other known places.
False if the Place is a known place.
Not returned when the partner does not provide the information.
For example, returns False for an address location that is found in the partner data, but returns True if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses.
Sourcepub fn time_zone(&self) -> Option<&TimeZone>
pub fn time_zone(&self) -> Option<&TimeZone>
The time zone in which the Place is located. Returned only when using HERE or Grab as the selected partner.
Sourcepub fn unit_type(&self) -> Option<&str>
pub fn unit_type(&self) -> Option<&str>
For addresses with a UnitNumber, the type of unit. For example, Apartment.
Returned only for a place index that uses Esri as a data provider.
Sourcepub fn unit_number(&self) -> Option<&str>
pub fn unit_number(&self) -> Option<&str>
For addresses with multiple units, the unit identifier. Can include numbers and letters, for example 3B or Unit 123.
Returned only for a place index that uses Esri or Grab as a data provider. Is not returned for SearchPlaceIndexForPosition.
Sourcepub fn categories(&self) -> &[String]
pub fn categories(&self) -> &[String]
The Amazon Location categories that describe this Place.
For more information about using categories, including a list of Amazon Location categories, see Categories and filtering, in the Amazon Location Service developer guide.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .categories.is_none().
Sourcepub fn supplemental_categories(&self) -> &[String]
pub fn supplemental_categories(&self) -> &[String]
Categories from the data provider that describe the Place that are not mapped to any Amazon Location categories.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .supplemental_categories.is_none().
Sourcepub fn sub_municipality(&self) -> Option<&str>
pub fn sub_municipality(&self) -> Option<&str>
An area that's part of a larger municipality. For example, Blissville is a submunicipality in the Queen County in New York.
This property supported by Esri and OpenData. The Esri property is district, and the OpenData property is borough.
Trait Implementations§
impl StructuralPartialEq for Place
Auto Trait Implementations§
impl Freeze for Place
impl RefUnwindSafe for Place
impl Send for Place
impl Sync for Place
impl Unpin for Place
impl UnwindSafe for Place
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§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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);