[−][src]Struct abstio::CityName
A single city is identified using this.
Fields
country: String
A two letter lowercase country code, from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.
To represent imaginary/test cities, use the code zz
.
city: String
The name of the city, in filename-friendly form -- for example, "tel_aviv".
Implementations
impl CityName
[src]
pub fn new(country: &str, city: &str) -> CityName
[src]
Create a CityName from a country code and city.
pub fn list_all_cities_from_system_data() -> Vec<CityName>
[src]
Returns all city names based on system data.
pub fn list_all_cities_from_importer_config() -> Vec<CityName>
[src]
Returns all city names based on importer config.
pub fn parse(x: &str) -> Result<CityName>
[src]
Parses a CityName from something like "gb/london"; the inverse of to_path
.
pub fn to_path(&self) -> String
[src]
Expresses the city as a path, like "gb/london"; the inverse of parse
.
pub fn describe(&self) -> String
[src]
Stringify the city name for debug messages. Don't implement std::fmt::Display
, to force
callers to explicitly opt into this description, which could change.
pub fn input_path<I: Into<String>>(&self, file: I) -> String
[src]
Constructs the path to some city-scoped data/input.
Trait Implementations
impl Clone for CityName
[src]
impl Debug for CityName
[src]
impl<'de> Deserialize<'de> for CityName
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for CityName
[src]
impl Ord for CityName
[src]
fn cmp(&self, other: &CityName) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<CityName> for CityName
[src]
impl PartialOrd<CityName> for CityName
[src]
fn partial_cmp(&self, other: &CityName) -> Option<Ordering>
[src]
fn lt(&self, other: &CityName) -> bool
[src]
fn le(&self, other: &CityName) -> bool
[src]
fn gt(&self, other: &CityName) -> bool
[src]
fn ge(&self, other: &CityName) -> bool
[src]
impl Serialize for CityName
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for CityName
[src]
impl StructuralPartialEq for CityName
[src]
Auto Trait Implementations
impl RefUnwindSafe for CityName
[src]
impl Send for CityName
[src]
impl Sync for CityName
[src]
impl Unpin for CityName
[src]
impl UnwindSafe for CityName
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,