pub struct Country { /* private fields */ }Expand description
A struct containing useful information for a country.
Implementations§
source§impl Country
impl Country
pub fn alpha2(&self) -> Alpha2
pub fn alpha3(&self) -> Alpha3
pub fn country_code(&self) -> usize
pub fn continent(&self) -> Continent
pub fn currency_code(&self) -> CurrencyCode
sourcepub fn address_format(&self) -> Option<&str>
pub fn address_format(&self) -> Option<&str>
A regex that helps you validate address format of this country.
sourcepub fn geo(&self) -> CountryGeo
pub fn geo(&self) -> CountryGeo
Enabled if geo feature is enabled.
pub fn international_prefix(&self) -> &str
pub fn iso_long_name(&self) -> &str
pub fn iso_short_name(&self) -> &str
pub fn official_language_list(&self) -> &[&str]
pub fn spoken_language_list(&self) -> &[&str]
pub fn national_destination_code_length_list(&self) -> &[usize]
pub fn national_number_length_list(&self) -> &[u8] ⓘ
pub fn national_prefix(&self) -> &str
pub fn nationality(&self) -> Option<&str>
pub fn number(&self) -> &str
pub fn postal_code(&self) -> bool
pub fn postal_code_format(&self) -> Option<&str>
pub fn region(&self) -> Option<Region>
pub fn start_of_week(&self) -> WeekDay
pub fn subregion(&self) -> Option<SubRegion>
pub fn un_locode(&self) -> &str
pub fn unofficial_name_list(&self) -> &[&str]
pub fn world_region(&self) -> WorldRegion
pub fn emoji(&self) -> &str
sourcepub fn translations(&self) -> &HashMap<&str, &str>
pub fn translations(&self) -> &HashMap<&str, &str>
A hashmap containing languages as keys and translations as values.
Enabled if translations feature is enabled.
sourcepub fn subdivisions(&self) -> &HashMap<&str, Subdivision>
pub fn subdivisions(&self) -> &HashMap<&str, Subdivision>
Enabled if subdivisions feature is enabled.
sourcepub fn g20_member(&self) -> bool
pub fn g20_member(&self) -> bool
Is this country a member of G20?
sourcepub fn eea_member(&self) -> bool
pub fn eea_member(&self) -> bool
Is this country a member of EEA?
sourcepub fn gdpr_compliant(&self) -> bool
pub fn gdpr_compliant(&self) -> bool
Is this country GDPR compliant?
sourcepub fn vat_rates(&self) -> Option<&VatRates>
pub fn vat_rates(&self) -> Option<&VatRates>
Value-added Tax for this country.
sourcepub fn distance_unit(&self) -> DistanceUnit
pub fn distance_unit(&self) -> DistanceUnit
Km or Mi.
source§impl Country
impl Country
pub fn find_in_subdivisions<F>( &self, search: F ) -> Result<Subdivision, SearchError>
pub fn find_in_subdivisions_by_code( &self, code: &str ) -> Result<Subdivision, SearchError>
pub fn find_in_subdivisions_by_name( &self, name: &str ) -> Result<Subdivision, SearchError>
pub fn find_in_subdivisions_by_unofficial_name( &self, unofficial_name: &str ) -> Result<Subdivision, SearchError>
Trait Implementations§
source§impl Deserialize<'static> for Country
impl Deserialize<'static> for Country
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
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 PartialEq for Country
impl PartialEq for Country
Auto Trait Implementations§
impl RefUnwindSafe for Country
impl Send for Country
impl Sync for Country
impl Unpin for Country
impl UnwindSafe for Country
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