[−][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 seattle() -> CityName
[src]
Convenient constructor for the main city of the game.
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: AsRef<str>>(&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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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>,