pub struct Country { /* private fields */ }Expand description
A country in the list of countries defined by ISO 3166-1.
§Examples
use countries_tools::{Country, CountryAlpha2};
let united_states = Country::from(CountryAlpha2::US);
println!("{} is in North America.", united_states);
// Prints "United States of America is in North America."
assert_eq!(united_states.short_name(), "United States of America");Implementations§
Source§impl Country
impl Country
pub const fn alpha2(&self) -> CountryAlpha2
pub const fn alpha3(&self) -> CountryAlpha3
pub const fn numeric(&self) -> u16
pub const fn short_name(&self) -> &'static str
Trait Implementations§
Source§impl From<CountryAlpha2> for Country
impl From<CountryAlpha2> for Country
Source§fn from(value: CountryAlpha2) -> Self
fn from(value: CountryAlpha2) -> Self
Converts to this type from the input type.
Source§impl From<CountryAlpha3> for Country
impl From<CountryAlpha3> for Country
Source§fn from(value: CountryAlpha3) -> Self
fn from(value: CountryAlpha3) -> Self
Converts to this type from the input type.
impl Copy for Country
impl Eq for Country
impl StructuralPartialEq for Country
Auto Trait Implementations§
impl Freeze for Country
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