[][src]Struct abstio::abst_paths::MapName

pub struct MapName {
    pub city: String,
    pub map: String,
}

A single map is identified using this. Using a struct makes refactoring later easier, to organize cities hierarchially.

Fields

city: String

The name of the city, in filename-friendly form -- for example, "tel_aviv". In the future, this field may change to express more geographic hierarchy.

map: String

The name of the map within the city, in filename-friendly form -- for example, "downtown"

Implementations

impl MapName[src]

pub fn new(city: &str, map: &str) -> MapName[src]

Create a MapName from a simple city and map name.

pub fn seattle(map: &str) -> MapName[src]

Convenient constructor for the main city of the game.

pub fn describe(&self) -> String[src]

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.

pub fn as_filename(&self) -> String[src]

Stringify the map name for filenames.

pub fn from_path(path: &str) -> Option<MapName>[src]

Transforms a path to a map back to a MapName. Returns None if the input is strange.

pub fn path(&self) -> String[src]

Returns the filesystem path to this map.

pub fn list_all_cities() -> Vec<String>[src]

Returns all city names.

pub fn list_all_maps_in_city(city: &str) -> Vec<MapName>[src]

Returns all maps from one city.

pub fn list_all_maps() -> Vec<MapName>[src]

Returns all maps from all cities.

Trait Implementations

impl Clone for MapName[src]

impl Debug for MapName[src]

impl<'de> Deserialize<'de> for MapName[src]

impl Eq for MapName[src]

impl Ord for MapName[src]

impl PartialEq<MapName> for MapName[src]

impl PartialOrd<MapName> for MapName[src]

impl Serialize for MapName[src]

impl StructuralEq for MapName[src]

impl StructuralPartialEq for MapName[src]

Auto Trait Implementations

impl RefUnwindSafe for MapName[src]

impl Send for MapName[src]

impl Sync for MapName[src]

impl Unpin for MapName[src]

impl UnwindSafe for MapName[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.