scryfall/
format.rs

1//! The available magic the gathering formats.
2use std::fmt;
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Serialize, Deserialize, Copy, Clone, Eq, PartialEq, Hash, Debug)]
7#[allow(missing_docs)]
8#[non_exhaustive]
9pub enum Format {
10    Standard,
11    Modern,
12    Legacy,
13    Vintage,
14    Commander,
15    Future,
16    Pauper,
17    Pioneer,
18    Penny,
19    Duel,
20    OldSchool,
21    Historic,
22    Gladiator,
23    Brawl,
24    Premodern,
25    PauperCommander,
26    Alchemy,
27    Explorer,
28    Predh,
29    Oathbreaker,
30    Timeless,
31    StandardBrawl,
32    HistoricBrawl,
33}
34
35impl fmt::Display for Format {
36    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
37        use Format::*;
38        write!(
39            f,
40            "{}",
41            match self {
42                Standard => "standard",
43                Modern => "modern",
44                Legacy => "legacy",
45                Vintage => "vintage",
46                Commander => "commander",
47                Future => "future",
48                Pauper => "pauper",
49                Pioneer => "pioneer",
50                Penny => "penny",
51                Duel => "duel",
52                OldSchool => "oldschool",
53                Historic => "historic",
54                Gladiator => "gladiator",
55                Brawl => "brawl",
56                Premodern => "premodern",
57                PauperCommander => "paupercommander",
58                Alchemy => "alchemy",
59                Explorer => "explorer",
60                Predh => "predh",
61                Oathbreaker => "oathbreaker",
62                Timeless => "timeless",
63                StandardBrawl => "standardbrawl",
64                HistoricBrawl => "historicbrawl",
65            }
66        )
67    }
68}