pub enum City {
Show 47 variants
Edinburgh,
London,
Dieppe,
Amsterdam,
Brest,
Paris,
Bruxelles,
Essen,
Frankfurt,
Pamplona,
Zuerich,
Marseille,
Kobenhavn,
Berlin,
Muenchen,
Madrid,
Barcelona,
Venezia,
Roma,
Stockholm,
Danzig,
Warszawa,
Wien,
Lisboa,
Cadiz,
Zagrab,
Brindisi,
Palermo,
Petrograd,
Riga,
Wilno,
Kyiv,
Budapest,
Sarajevo,
Athina,
Smyrna,
Moskva,
Smolensk,
Kharkov,
Bucuresti,
Sofia,
Constantinople,
Angora,
Rostov,
Sevastopol,
Erzurum,
Sochi,
}Expand description
All available cities of the game are included into this handy enumeration, so that my code is more clear. The cities are not entered with any particular order, I just started from Edinburgh and traversed the map gradually most of the times randomly.
Variants§
Edinburgh
These are all cities included in the board game of Ticket to Ride, Europe edition. They don’t have a specific meaning to be documented, other than that they are a nice way to keep track for me.
London
Dieppe
Amsterdam
Brest
Paris
Bruxelles
Essen
Frankfurt
Pamplona
Zuerich
Marseille
Kobenhavn
Berlin
Muenchen
Madrid
Barcelona
Venezia
Roma
Stockholm
Danzig
Warszawa
Wien
Lisboa
Cadiz
Zagrab
Brindisi
Palermo
Petrograd
Riga
Wilno
Kyiv
Budapest
Sarajevo
Athina
Smyrna
Moskva
Smolensk
Kharkov
Bucuresti
Sofia
Constantinople
Angora
Rostov
Sevastopol
Erzurum
Sochi
Trait Implementations§
Source§impl FromStr for City
The FromStr trait gives to the enumeration the handy from_str
function that is used to convert a string (provided by command
line arguments) to a City. I had to map each string to the
specific city.
impl FromStr for City
The FromStr trait gives to the enumeration the handy from_str function that is used to convert a string (provided by command line arguments) to a City. I had to map each string to the specific city.
§Example
let start_city = "Athina"; // This could come from clap
let begin = City::from_str(start_city).unwrap();impl Copy for City
impl Eq for City
impl StructuralPartialEq for City
Auto Trait Implementations§
impl Freeze for City
impl RefUnwindSafe for City
impl Send for City
impl Sync for City
impl Unpin for City
impl UnwindSafe for City
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
Mutably borrows from an owned value. Read more