#[non_exhaustive]pub struct GeocodeResultItem {Show 19 fields
pub place_id: String,
pub place_type: PlaceType,
pub title: String,
pub address: Option<Address>,
pub address_number_corrected: Option<bool>,
pub postal_code_details: Option<Vec<PostalCodeDetails>>,
pub position: Option<Vec<f64>>,
pub distance: i64,
pub map_view: Option<Vec<f64>>,
pub categories: Option<Vec<Category>>,
pub food_types: Option<Vec<FoodType>>,
pub access_points: Option<Vec<AccessPoint>>,
pub time_zone: Option<TimeZone>,
pub political_view: Option<String>,
pub match_scores: Option<MatchScoreDetails>,
pub parsed_query: Option<GeocodeParsedQuery>,
pub intersections: Option<Vec<Intersection>>,
pub main_address: Option<RelatedPlace>,
pub secondary_addresses: Option<Vec<RelatedPlace>>,
}
Expand description
The Geocoded result.
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.place_id: String
The PlaceId
of the place result.
place_type: PlaceType
A PlaceType
is a category that the result place must belong to.
title: String
The localized display name of this result item based on request parameter language
.
address: Option<Address>
The place's address.
address_number_corrected: Option<bool>
Boolean indicating if the address provided has been corrected.
postal_code_details: Option<Vec<PostalCodeDetails>>
Contains details about the postal code of the place/result.
position: Option<Vec<f64>>
The position in longitude and latitude.
distance: i64
The distance in meters from the QueryPosition.
map_view: Option<Vec<f64>>
The bounding box enclosing the geometric shape (area or line) that an individual result covers.
The bounding box formed is defined as a set 4 coordinates: \[{westward lng}, {southern lat}, {eastward lng}, {northern lat}\]
categories: Option<Vec<Category>>
Categories of results that results must belong to.
food_types: Option<Vec<FoodType>>
List of food types offered by this result.
access_points: Option<Vec<AccessPoint>>
Position of the access point represented by longitude and latitude.
time_zone: Option<TimeZone>
The time zone in which the place is located.
political_view: Option<String>
The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.
match_scores: Option<MatchScoreDetails>
Indicates how well the entire input matches the returned. It is equal to 1 if all input tokens are recognized and matched.
parsed_query: Option<GeocodeParsedQuery>
Free-form text query.
intersections: Option<Vec<Intersection>>
All Intersections that are near the provided address.
main_address: Option<RelatedPlace>
The main address corresponding to a place of type Secondary Address.
secondary_addresses: Option<Vec<RelatedPlace>>
All secondary addresses that are associated with a main address. A secondary address is one that includes secondary designators, such as a Suite or Unit Number, Building, or Floor information.
Implementations§
Source§impl GeocodeResultItem
impl GeocodeResultItem
Sourcepub fn place_type(&self) -> &PlaceType
pub fn place_type(&self) -> &PlaceType
A PlaceType
is a category that the result place must belong to.
Sourcepub fn title(&self) -> &str
pub fn title(&self) -> &str
The localized display name of this result item based on request parameter language
.
Sourcepub fn address_number_corrected(&self) -> Option<bool>
pub fn address_number_corrected(&self) -> Option<bool>
Boolean indicating if the address provided has been corrected.
Sourcepub fn postal_code_details(&self) -> &[PostalCodeDetails]
pub fn postal_code_details(&self) -> &[PostalCodeDetails]
Contains details about the postal code of the place/result.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .postal_code_details.is_none()
.
Sourcepub fn position(&self) -> &[f64]
pub fn position(&self) -> &[f64]
The position in longitude and latitude.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .position.is_none()
.
Sourcepub fn map_view(&self) -> &[f64]
pub fn map_view(&self) -> &[f64]
The bounding box enclosing the geometric shape (area or line) that an individual result covers.
The bounding box formed is defined as a set 4 coordinates: \[{westward lng}, {southern lat}, {eastward lng}, {northern lat}\]
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .map_view.is_none()
.
Sourcepub fn categories(&self) -> &[Category]
pub fn categories(&self) -> &[Category]
Categories of results that results must belong to.
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 food_types(&self) -> &[FoodType]
pub fn food_types(&self) -> &[FoodType]
List of food types offered by this result.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .food_types.is_none()
.
Sourcepub fn access_points(&self) -> &[AccessPoint]
pub fn access_points(&self) -> &[AccessPoint]
Position of the access point represented by longitude and latitude.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .access_points.is_none()
.
Sourcepub fn political_view(&self) -> Option<&str>
pub fn political_view(&self) -> Option<&str>
The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.
Sourcepub fn match_scores(&self) -> Option<&MatchScoreDetails>
pub fn match_scores(&self) -> Option<&MatchScoreDetails>
Indicates how well the entire input matches the returned. It is equal to 1 if all input tokens are recognized and matched.
Sourcepub fn parsed_query(&self) -> Option<&GeocodeParsedQuery>
pub fn parsed_query(&self) -> Option<&GeocodeParsedQuery>
Free-form text query.
Sourcepub fn intersections(&self) -> &[Intersection]
pub fn intersections(&self) -> &[Intersection]
All Intersections that are near the provided address.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .intersections.is_none()
.
Sourcepub fn main_address(&self) -> Option<&RelatedPlace>
pub fn main_address(&self) -> Option<&RelatedPlace>
The main address corresponding to a place of type Secondary Address.
Sourcepub fn secondary_addresses(&self) -> &[RelatedPlace]
pub fn secondary_addresses(&self) -> &[RelatedPlace]
All secondary addresses that are associated with a main address. A secondary address is one that includes secondary designators, such as a Suite or Unit Number, Building, or Floor information.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .secondary_addresses.is_none()
.
Source§impl GeocodeResultItem
impl GeocodeResultItem
Sourcepub fn builder() -> GeocodeResultItemBuilder
pub fn builder() -> GeocodeResultItemBuilder
Creates a new builder-style object to manufacture GeocodeResultItem
.
Trait Implementations§
Source§impl Clone for GeocodeResultItem
impl Clone for GeocodeResultItem
Source§fn clone(&self) -> GeocodeResultItem
fn clone(&self) -> GeocodeResultItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GeocodeResultItem
impl Debug for GeocodeResultItem
Source§impl PartialEq for GeocodeResultItem
impl PartialEq for GeocodeResultItem
impl StructuralPartialEq for GeocodeResultItem
Auto Trait Implementations§
impl Freeze for GeocodeResultItem
impl RefUnwindSafe for GeocodeResultItem
impl Send for GeocodeResultItem
impl Sync for GeocodeResultItem
impl Unpin for GeocodeResultItem
impl UnwindSafe for GeocodeResultItem
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);