[][src]Enum swiss_canton::SwissCanton

pub enum SwissCanton {
    AG,
    AI,
    AR,
    BE,
    BL,
    BS,
    FR,
    GE,
    GL,
    GR,
    JU,
    LU,
    NE,
    NW,
    OW,
    SG,
    SH,
    SO,
    SZ,
    TG,
    TI,
    UR,
    VD,
    VS,
    ZG,
    ZH,
}

Swiss Canton Enum

If your code has to do canton-specific things you can use this enum.

Example

You can use the enum to control something in your code:

use swiss_canton::SwissCanton;

let canton = SwissCanton::ZH;

match canton {
    SwissCanton::ZH => println!("Salü!"),
    SwissCanton::NE => println!("Bonjour !"),
    _ => println!("Grüezi!")
}

You can also parse, compare and print the short code of the canton:

use swiss_canton::SwissCanton;

let parsed_canton = "TI".parse::<SwissCanton>().unwrap();

if (parsed_canton.eq(&SwissCanton::TI)) {
    println!("Buongiorno in {}!", SwissCanton::TI);
}

Variants

AG

Aargau

Example

use swiss_canton::SwissCanton;
SwissCanton::AG;
AI

Appenzell Innerrhoden

Example

use swiss_canton::SwissCanton;
SwissCanton::AI;
AR

Appenzell Ausserrhoden

Example

use swiss_canton::SwissCanton;
SwissCanton::AR;
BE

Bern

Example

use swiss_canton::SwissCanton;
SwissCanton::BE;
BL

Basel-Landschaft

Example

use swiss_canton::SwissCanton;
SwissCanton::BL;
BS

Basel-Stadt

Example

use swiss_canton::SwissCanton;
SwissCanton::BS;
FR

Fribourg

Example

use swiss_canton::SwissCanton;
SwissCanton::FR;
GE

Geneva

Example

use swiss_canton::SwissCanton;
SwissCanton::GE;
GL

Glarus

Example

use swiss_canton::SwissCanton;
SwissCanton::GL;
GR

Graubünden, Grisons

Example

use swiss_canton::SwissCanton;
SwissCanton::GR;
JU

Jura

Example

use swiss_canton::SwissCanton;
SwissCanton::JU;
LU

Luzern

Example

use swiss_canton::SwissCanton;
SwissCanton::LU;
NE

Neuchâtel

Example

use swiss_canton::SwissCanton;
SwissCanton::NE;
NW

Nidwalden

Example

use swiss_canton::SwissCanton;
SwissCanton::NW;
OW

Obwalden

Example

use swiss_canton::SwissCanton;
SwissCanton::OW;
SG

St. Gallen

Example

use swiss_canton::SwissCanton;
SwissCanton::SG;
SH

Schaffhausen

Example

use swiss_canton::SwissCanton;
SwissCanton::SH;
SO

Solothurn

Example

use swiss_canton::SwissCanton;
SwissCanton::SO;
SZ

Schwyz

Example

use swiss_canton::SwissCanton;
SwissCanton::SZ;
TG

Thurgau

Example

use swiss_canton::SwissCanton;
SwissCanton::TG;
TI

Ticino

Example

use swiss_canton::SwissCanton;
SwissCanton::TI;
UR

Uri

Example

use swiss_canton::SwissCanton;
SwissCanton::UR;
VD

Vaud

Example

use swiss_canton::SwissCanton;
SwissCanton::VD;
VS

Valais

Example

use swiss_canton::SwissCanton;
SwissCanton::VS;
ZG

Zug

Example

use swiss_canton::SwissCanton;
SwissCanton::ZG;
ZH

Zürich

Example

use swiss_canton::SwissCanton;
SwissCanton::ZH;

Trait Implementations

impl Debug for SwissCanton[src]

impl Display for SwissCanton[src]

impl FromStr for SwissCanton[src]

type Err = SwissCantonError

The associated error which can be returned from parsing.

impl PartialEq<SwissCanton> for SwissCanton[src]

impl StructuralPartialEq for SwissCanton[src]

Auto Trait Implementations

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> From<T> for T[src]

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.