Struct keshvar::Country

source ·
pub struct Country { /* private fields */ }
Expand description

A struct containing useful information for a country.

Implementations§

source§

impl Country

source

pub fn alpha2(&self) -> Alpha2

source

pub fn alpha3(&self) -> Alpha3

source

pub fn country_code(&self) -> usize

source

pub fn continent(&self) -> Continent

source

pub fn currency_code(&self) -> CurrencyCode

source

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

A regex that helps you validate address format of this country.

source

pub fn gec(&self) -> Option<GEC>

GEC (Geopolitical Entities and Codes) for this country.

source

pub fn geo(&self) -> CountryGeo

Enabled if geo feature is enabled.

source

pub fn international_prefix(&self) -> &str

source

pub fn ioc(&self) -> Option<IOC>

IOC (International Olympic Committee) for this country.

source

pub fn iso_long_name(&self) -> &str

source

pub fn iso_short_name(&self) -> &str

source

pub fn official_language_list(&self) -> &[&str]

source

pub fn spoken_language_list(&self) -> &[&str]

source

pub fn national_destination_code_length_list(&self) -> &[usize]

source

pub fn national_number_length_list(&self) -> &[u8]

source

pub fn national_prefix(&self) -> &str

source

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

source

pub fn number(&self) -> &str

source

pub fn postal_code(&self) -> bool

source

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

source

pub fn region(&self) -> Option<Region>

source

pub fn start_of_week(&self) -> WeekDay

source

pub fn subregion(&self) -> Option<SubRegion>

source

pub fn un_locode(&self) -> &str

source

pub fn unofficial_name_list(&self) -> &[&str]

source

pub fn world_region(&self) -> WorldRegion

source

pub fn emoji(&self) -> &str

source

pub fn translations(&self) -> &HashMap<&str, &str>

A hashmap containing languages as keys and translations as values. Enabled if translations feature is enabled.

source

pub fn subdivisions(&self) -> &HashMap<&str, Subdivision>

Enabled if subdivisions feature is enabled.

source

pub fn g7_member(&self) -> bool

Is this country a member of G7?.

source

pub fn g20_member(&self) -> bool

Is this country a member of G20?

source

pub fn eu_member(&self) -> bool

Is this country a member of EU?

source

pub fn eea_member(&self) -> bool

Is this country a member of EEA?

source

pub fn gdpr_compliant(&self) -> bool

Is this country GDPR compliant?

source

pub fn vat_rates(&self) -> Option<&VatRates>

Value-added Tax for this country.

source

pub fn distance_unit(&self) -> DistanceUnit

Km or Mi.

source§

impl Country

Trait Implementations§

source§

impl Clone for Country

source§

fn clone(&self) -> Country

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Country

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deserialize<'static> for Country

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'static>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Alpha2> for Country

source§

fn from(alpha2: Alpha2) -> Self

Converts to this type from the input type.
source§

impl From<Alpha3> for Country

source§

fn from(alpha3: Alpha3) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Country

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Country

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&str> for Country

source§

fn try_from(value: &str) -> Result<Self, Self::Error>

The value should be Alpha2, Alpha3, GEC, IOC of a country in string format.

§

type Error = SearchError

The type returned in the event of a conversion error.

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.