Struct NormalizedCityRecord

Source
pub struct NormalizedCityRecord<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> NormalizedCityRecord<'a>

Source

pub fn country_code(&self) -> Option<&str>

Returns the country iso code

Source

pub fn country_name(&self, language: Option<&'a str>) -> Option<String>

Returns the country name

Source

pub fn registered_country_iso_code(&self) -> Option<&str>

Returns the registered country iso code of record NormalizedCityRecord.

Source

pub fn registered_country_name( &self, language: Option<&'a str>, ) -> Option<String>

Returns the registered country name of record NormalizedCityRecord. Accepts a language code. Returns None if the country is not available.

Source

pub fn represented_country_iso_code(&self) -> Option<&str>

Returns the registered country name of record NormalizedCityRecord. Returns None if the country iso code is not available.

Source

pub fn represented_country_name( &self, language: Option<&'a str>, ) -> Option<String>

Returns the registered country name of record NormalizedCityRecord. Accepts a language code. Returns None if the country is not available.

Source

pub fn city_name(&self, language: Option<&'a str>) -> Option<String>

Returns the city name of record NormalizedCityRecord. Accepts a language code. Returns None if the city is not available.

Source

pub fn city_geoname_id(&self) -> Option<u32>

Returns the city geoname id of record NormalizedCityRecord. Returns None if the city geoname id is not available.

Source

pub fn subdivision_geoname_id(&self, idx: usize) -> Option<u32>

Returns the subdivision geoname id of record NormalizedCityRecord. Accepts index of subdivision. Returns None if the subdivision geoname id is not available.

Source

pub fn subdivision_name( &self, idx: usize, language: Option<&'a str>, ) -> Option<String>

Returns the subdivision name of record NormalizedCityRecord. Accepts index of subdivision and preferred language. Returns None if the subdivision name is not available.

Source

pub fn subdivision_iso_code(&self, idx: usize) -> Option<&str>

Returns the subdivision iso code of record NormalizedCityRecord. Accepts index of subdivision. Returns None if the subdivision iso code is not available.

Source

pub fn continent_code(&self) -> Option<&str>

Returns the continent code of record NormalizedCityRecord. Returns None if the continent code is not available.

Source

pub fn continent_geoname_id(&self) -> Option<u32>

Returns the continent geoname id of record NormalizedCityRecord. Returns None if the continent geoname id is not available.

Source

pub fn continent_name(&self, language: Option<&'a str>) -> Option<String>

Returns the continent name of record NormalizedCityRecord. Accepts a language code. Returns None if the continent name is not available.

Source

pub fn postal_code(&self) -> Option<&str>

Returns the postal code of record NormalizedCityRecord. Returns None if the postal code is not available.

Source

pub fn time_zone(&self) -> Option<&str>

Returns the timezone of record NormalizedCityRecord. Returns None if the timezone is not available.

Source

pub fn lon_and_lat(&self) -> Option<(f64, f64)>

Returns the [Option<(f64, f64)>] of record NormalizedCityRecord. Returns None if the latitude is not available.

Trait Implementations§

Source§

impl<'a> From<City<'a>> for NormalizedCityRecord<'a>

Source§

fn from(city: City<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.