Struct abstio::abst_paths::CityName [−][src]
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]
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.
fn list_all_cities_locally() -> Vec<CityName>
[src]
Returns all city names available locally.
pub fn list_all_cities_from_manifest(manifest: &Manifest) -> Vec<CityName>
[src]
Returns all city names based on the manifest of available files.
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<'de> Deserialize<'de> 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 PartialOrd<CityName> for CityName
[src]
impl PartialOrd<CityName> for CityName
[src]impl Eq for CityName
[src]
impl StructuralEq for CityName
[src]
impl StructuralPartialEq for CityName
[src]
Auto Trait Implementations
impl RefUnwindSafe for CityName
impl Send for CityName
impl Sync for CityName
impl Unpin for CityName
impl UnwindSafe for CityName
Blanket Implementations
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Instrument 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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,