ed_journals/modules/station/models/
station_service.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
use std::fmt::{Display, Formatter};

use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum StationService {
    #[serde(rename = "ondockmission")]
    OnDockMission,

    #[serde(rename = "blackmarket")]
    BlackMarket,

    #[serde(rename = "missions")]
    Missions,

    #[serde(rename = "missionsgenerated")]
    MissionsGenerated,

    #[serde(rename = "facilitator")]
    Facilitator,

    #[serde(rename = "powerplay")]
    Powerplay,

    #[serde(rename = "outfitting")]
    Outfitting,

    #[serde(rename = "livery")]
    Livery,

    /// Tuning is an old service that does not hold any meaning anymore. Check this
    /// [Frontiers community forum post](https://forums.frontier.co.uk/threads/tuning-in-station-facilities-what-is-it.362951/)
    #[serde(rename = "tuning")]
    Tuning,

    #[serde(rename = "searchrescue")]
    SearchAndRescue,

    #[serde(rename = "dock")]
    Dock,

    #[serde(rename = "autodock")]
    AutoDock,

    #[serde(rename = "commodities")]
    Commodities,

    #[serde(rename = "contacts")]
    Contacts,

    #[serde(rename = "exploration")]
    Exploration,

    #[serde(rename = "crewlounge")]
    CrewLounge,

    #[serde(rename = "rearm")]
    Rearm,

    #[serde(rename = "refuel")]
    Refuel,

    #[serde(rename = "repair")]
    Repair,

    #[serde(rename = "engineer")]
    Engineer,

    #[serde(rename = "flightcontroller")]
    FlightController,

    #[serde(rename = "stationoperations")]
    StationOperations,

    #[serde(rename = "stationMenu")]
    StationMenu,

    #[serde(rename = "carriervendor")]
    CarrierVendor,

    #[serde(rename = "carrierfuel")]
    CarrierFuel,

    #[serde(rename = "carriermanagement")]
    CarrierManagement,

    #[serde(rename = "socialspace")]
    SocialSpace,

    #[serde(rename = "bartender")]
    Bartender,

    #[serde(rename = "apexinterstellar")]
    ApexInterstellar,

    #[serde(rename = "vistagenomics")]
    VistaGenomics,

    #[serde(rename = "pioneersupplies")]
    PioneerSupplies,

    #[serde(rename = "shipyard")]
    Shipyard,

    #[serde(rename = "voucherredemption")]
    RedemptionOffice,

    #[serde(rename = "frontlinesolutions")]
    FrontlineSolutions,

    #[serde(rename = "materialtrader")]
    MaterialTrader,

    #[serde(rename = "techBroker")]
    TechnologyBroker,

    // TODO not sure what this is
    #[serde(rename = "shop")]
    Shop,

    // TODO I assume this is where FC can buy module packs
    #[serde(rename = "modulepacks")]
    ModulePacks,

    #[cfg(feature = "allow-unknown")]
    #[cfg_attr(docsrs, doc(cfg(feature = "allow-unknown")))]
    #[serde(untagged)]
    Unknown(String),
}

impl Display for StationService {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "{}",
            match self {
                StationService::OnDockMission => "On-Dock Mission",
                StationService::BlackMarket => "Black Market",
                StationService::Missions => "Missions",
                StationService::MissionsGenerated => "Missions Generated",
                StationService::Facilitator => "Facilitator",
                StationService::Powerplay => "Powerplay",
                StationService::Outfitting => "Outfitting",
                StationService::Livery => "Livery",
                StationService::Tuning => "Tuning",
                StationService::SearchAndRescue => "Search & Rescue",
                StationService::Dock => "Dock",
                StationService::AutoDock => "Auto Dock",
                StationService::Commodities => "Commodities",
                StationService::Contacts => "Contacts",
                StationService::Exploration => "Exploration",
                StationService::CrewLounge => "Crew Lounge",
                StationService::Rearm => "Rearm",
                StationService::Refuel => "Refuel",
                StationService::Repair => "Repair",
                StationService::Engineer => "Engineer",
                StationService::FlightController => "Flight Controller",
                StationService::StationOperations => "Station Operations",
                StationService::StationMenu => "Station Menu",
                StationService::CarrierVendor => "Carrier Vendor",
                StationService::CarrierFuel => "Carrier Fuel",
                StationService::CarrierManagement => "Carrier Management",
                StationService::SocialSpace => "Social Space",
                StationService::Bartender => "Bartender",
                StationService::ApexInterstellar => "Apex Interstellar",
                StationService::VistaGenomics => "Vista Genomics",
                StationService::PioneerSupplies => "Pioneer Supplies",
                StationService::Shipyard => "Shipyard",
                StationService::RedemptionOffice => "Redemption Office",
                StationService::FrontlineSolutions => "Frontline Solutions",
                StationService::MaterialTrader => "Material Trader",
                StationService::TechnologyBroker => "Technology Broker",
                StationService::Shop => "Shop",
                StationService::ModulePacks => "Module Packs",

                #[cfg(feature = "allow-unknown")]
                StationService::Unknown(unknown) =>
                    return write!(f, "Unknown station service: {}", unknown),
            }
        )
    }
}