pub struct RegionClassificationCode(/* private fields */);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 duplicate 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 Code<u16> for RegionClassificationCode
impl Code<u16> for RegionClassificationCode
Source§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.
Source§impl FromStr for RegionClassificationCode
impl FromStr for RegionClassificationCode
Source§impl Hash for RegionClassificationCode
impl Hash for RegionClassificationCode
Source§impl PartialEq for RegionClassificationCode
impl PartialEq for RegionClassificationCode
Source§impl Serialize for RegionClassificationCode
impl Serialize for RegionClassificationCode
Source§impl Standardized for RegionClassificationCode
impl Standardized for RegionClassificationCode
fn defining_standard() -> &'static Standard
impl Copy for RegionClassificationCode
impl Eq for RegionClassificationCode
impl StructuralPartialEq for RegionClassificationCode
Auto Trait Implementations§
impl Freeze for RegionClassificationCode
impl RefUnwindSafe for RegionClassificationCode
impl Send for RegionClassificationCode
impl Sync for RegionClassificationCode
impl Unpin for RegionClassificationCode
impl UnwindSafe for RegionClassificationCode
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