Struct abstio::abst_paths::CityName
source · [−]Expand description
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
sourceimpl CityName
impl CityName
sourcepub fn new(country: &str, city: &str) -> CityName
pub fn new(country: &str, city: &str) -> CityName
Create a CityName from a country code and city.
sourcefn list_all_cities_locally() -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn list_all_cities_locally() -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns all city names available locally.
sourcefn list_all_cities_from_manifest(manifest: &Manifest) -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn list_all_cities_from_manifest(manifest: &Manifest) -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns all city names based on the manifest of available files.
sourcepub fn list_all_cities_merged(manifest: &Manifest) -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn list_all_cities_merged(manifest: &Manifest) -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns all city names either available locally or based on the manifest of available files.
sourcepub fn list_all_cities_from_importer_config() -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn list_all_cities_from_importer_config() -> Vec<CityName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns all city names based on importer config.
sourcepub fn list_all_maps_in_city_from_importer_config(&self) -> Vec<MapName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn list_all_maps_in_city_from_importer_config(&self) -> Vec<MapName>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns all maps in a city based on importer config.
sourcepub fn parse(x: &str) -> Result<CityName>
pub fn parse(x: &str) -> Result<CityName>
Parses a CityName from something like “gb/london”; the inverse of to_path
.
sourcepub fn to_path(&self) -> String
pub fn to_path(&self) -> String
Expresses the city as a path, like “gb/london”; the inverse of parse
.
sourcepub fn describe(&self) -> String
pub fn describe(&self) -> String
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.
sourcepub fn input_path<I: AsRef<str>>(&self, file: I) -> String
pub fn input_path<I: AsRef<str>>(&self, file: I) -> String
Constructs the path to some city-scoped data/input.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for CityName
impl<'de> Deserialize<'de> for CityName
sourcefn 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
sourceimpl Ord for CityName
impl Ord for CityName
sourceimpl PartialOrd<CityName> for CityName
impl PartialOrd<CityName> for CityName
sourcefn partial_cmp(&self, other: &CityName) -> Option<Ordering>
fn partial_cmp(&self, other: &CityName) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for CityName
impl StructuralEq for CityName
impl StructuralPartialEq for CityName
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more