Struct codes_un_m49::RegionClassificationCode
source · pub struct RegionClassificationCode(_);Expand description
This structure encapsulates the integer code for regions defined in the UN M49 standard.
Implementations§
source§impl RegionClassificationCode
impl RegionClassificationCode
sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
Return the M49 defined name for this region. Note that where the
region this name may not be the same as the short_name defined
in the ISO 3166 CountryCode.
sourcepub const fn kind(&self) -> RegionKind
pub const fn kind(&self) -> RegionKind
Return the kind, or level, of this region.
sourcepub const fn parent_code(&self) -> Option<Self>
pub const fn parent_code(&self) -> Option<Self>
Return the RegionClassificationCode instance for the parent of this region if one is specified.
sourcepub const fn country_code(&self) -> Option<CountryCode>
pub const fn country_code(&self) -> Option<CountryCode>
If this region is a country (kind is RegionKind::Country) return the
ISO 3166 CountryCode corresponding to this region. Note that if the
feature country_codes is not specified this function will return &str.
Trait Implementations§
source§impl Clone for RegionClassificationCode
impl Clone for RegionClassificationCode
source§fn clone(&self) -> RegionClassificationCode
fn clone(&self) -> RegionClassificationCode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for RegionClassificationCode
impl Debug for RegionClassificationCode
source§impl<'de> Deserialize<'de> for RegionClassificationCode
impl<'de> Deserialize<'de> for RegionClassificationCode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for RegionClassificationCode
impl Display for RegionClassificationCode
source§impl From<RegionClassificationCode> for u16
impl From<RegionClassificationCode> for u16
source§fn from(v: RegionClassificationCode) -> Self
fn from(v: RegionClassificationCode) -> Self
Converts to this type from the input type.