pub struct MapName {
pub city: CityName,
pub map: String,
}
Expand description
A single map is identified using this.
Fields§
§city: CityName
§map: String
The name of the map within the city, in filename-friendly form – for example, “downtown”
Implementations§
Source§impl MapName
impl MapName
Sourcepub fn new(country: &str, city: &str, map: &str) -> MapName
pub fn new(country: &str, city: &str, map: &str) -> MapName
Create a MapName from a country code, city, and map name.
pub fn blank() -> Self
Sourcepub fn from_city(city: &CityName, map: &str) -> MapName
pub fn from_city(city: &CityName, map: &str) -> MapName
Create a MapName from a city and map within that city.
Sourcepub fn describe(&self) -> String
pub fn describe(&self) -> String
Stringify the map name for debug messages. Don’t implement std::fmt::Display
, to force
callers to explicitly opt into this description, which could change.
Sourcepub fn as_filename(&self) -> String
pub fn as_filename(&self) -> String
Stringify the map name for filenames.
Sourcepub fn from_path(path: &str) -> Option<MapName>
pub fn from_path(path: &str) -> Option<MapName>
Transforms a path to a map back to a MapName. Returns None
if the input is strange.
Sourcefn list_all_maps_in_city_locally(city: &CityName) -> Vec<MapName>
fn list_all_maps_in_city_locally(city: &CityName) -> Vec<MapName>
Returns all maps from one city that’re available locally.
Sourcepub fn list_all_maps_locally() -> Vec<MapName>
pub fn list_all_maps_locally() -> Vec<MapName>
Returns all maps from all cities available locally.
Sourcefn list_all_maps_from_manifest(manifest: &Manifest) -> Vec<MapName>
fn list_all_maps_from_manifest(manifest: &Manifest) -> Vec<MapName>
Returns all maps from all cities based on the manifest of available files.
Sourcepub fn list_all_maps_merged(manifest: &Manifest) -> Vec<MapName>
pub fn list_all_maps_merged(manifest: &Manifest) -> Vec<MapName>
Returns all maps from all cities either available locally or based on the manifest of available files.
Sourcefn list_all_maps_in_city_from_manifest(
city: &CityName,
manifest: &Manifest,
) -> Vec<MapName>
fn list_all_maps_in_city_from_manifest( city: &CityName, manifest: &Manifest, ) -> Vec<MapName>
Returns all maps from one city based on the manifest of available files.
Sourcepub fn list_all_maps_in_city_merged(
city: &CityName,
manifest: &Manifest,
) -> Vec<MapName>
pub fn list_all_maps_in_city_merged( city: &CityName, manifest: &Manifest, ) -> Vec<MapName>
Returns all maps from one city that’re available either locally or according to the manifest.
Sourcepub fn to_data_pack_name(&self) -> String
pub fn to_data_pack_name(&self) -> String
Returns the string to opt into runtime or input files for DataPacks.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MapName
impl<'de> Deserialize<'de> for MapName
Source§fn 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>,
Source§impl Ord for MapName
impl Ord for MapName
Source§impl PartialOrd for MapName
impl PartialOrd for MapName
impl CloneableAny for MapName
impl Eq for MapName
impl StructuralPartialEq for MapName
Auto Trait Implementations§
impl Freeze for MapName
impl RefUnwindSafe for MapName
impl Send for MapName
impl Sync for MapName
impl Unpin for MapName
impl UnwindSafe for MapName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.