zugferd_code_lists/zugferd_2_3_3/transport.rs
1#![allow(non_camel_case_types)]
2
3#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
5pub enum TRANSPORT {
6 /// Transport mode not specified
7 ///
8 /// Transport mode has not been specified_x000D_ Notes:_x000D_ 1) This code can be used when the mode is not known or when information on it is not available at the time of issuing the document concerned.
9 TransportModeNotSpecified,
10 /// Maritime transport
11 ///
12 /// Transport of goods and/or persons is by sea.
13 MaritimeTransport,
14 /// Rail transport
15 ///
16 /// Transport of goods and/or persons is by rail.
17 RailTransport,
18 /// Road transport
19 ///
20 /// Transport of goods and/or persons is by road.
21 RoadTransport,
22 /// Air transport
23 ///
24 /// Transport of goods and/or persons is by air.
25 AirTransport,
26 /// Mail
27 ///
28 /// Method to convey goods is by mail_x000D_ Notes:_x000D_ 1) This code is provided for practical reasons, despite the fact that mail is not a genuine mode of transport. In many countries, the value of merchandise exported and imported by mail is considerable, but the exporter or importer concerned would be unable to state by which mode postal items had been conveyed.
29 Mail,
30 /// Multimodal transpo
31 ///
32 /// Method to convey goods and/or persons is by multimodal transport._x000D_ Notes:_x000D_ 1) This code is provided for practical reasons, despite the fact that multimodal transport is not a genuine mode of transport. It can be used when goods are carried by at least two different modes from a place at which the goods are taken in charge by a transport operator to a place designated for delivery, on the basis of one transport contract. (Operations of pick-up and delivery of goods carried out in the performance of a single mode of transport, as defined in such a contract, shall not be considered as multimodal transport).
33 MultimodalTranspo,
34 /// Fixed transport installation
35 ///
36 /// Transport of item is via a fixed transport installation._x000D_ Notes:_x000D_ 1) This code applies to installations for continuous transport such as pipelines, ropeways and electric power lines.
37 FixedTransportInstallation,
38 /// Inland water transport
39 ///
40 /// Transport of goods and/or persons is by inland water.
41 InlandWaterTransport,
42 /// Transport mode not applicable
43 ///
44 /// The mode of transport is not applicable.
45 TransportModeNotApplicable,
46}
47
48impl crate::Code for TRANSPORT {
49 fn code(self) -> &'static str {
50 match self {
51 TRANSPORT::TransportModeNotSpecified => "0",
52 TRANSPORT::MaritimeTransport => "1",
53 TRANSPORT::RailTransport => "2",
54 TRANSPORT::RoadTransport => "3",
55 TRANSPORT::AirTransport => "4",
56 TRANSPORT::Mail => "5",
57 TRANSPORT::MultimodalTranspo => "6",
58 TRANSPORT::FixedTransportInstallation => "7",
59 TRANSPORT::InlandWaterTransport => "8",
60 TRANSPORT::TransportModeNotApplicable => "9",
61 }
62 }
63}
64
65impl crate::Description for TRANSPORT {
66 fn description(self) -> &'static str {
67 match self {
68 TRANSPORT::TransportModeNotSpecified => "Transport mode not specified",
69 TRANSPORT::MaritimeTransport => "Maritime transport",
70 TRANSPORT::RailTransport => "Rail transport",
71 TRANSPORT::RoadTransport => "Road transport",
72 TRANSPORT::AirTransport => "Air transport",
73 TRANSPORT::Mail => "Mail",
74 TRANSPORT::MultimodalTranspo => "Multimodal transpo",
75 TRANSPORT::FixedTransportInstallation => "Fixed transport installation",
76 TRANSPORT::InlandWaterTransport => "Inland water transport",
77 TRANSPORT::TransportModeNotApplicable => "Transport mode not applicable",
78 }
79 }
80}
81
82impl crate::FromCode for TRANSPORT {
83 fn from_code(code: &str) -> Option<Self>
84 where
85 Self: Sized,
86 {
87 match code {
88 "0" => Some(TRANSPORT::TransportModeNotSpecified),
89 "1" => Some(TRANSPORT::MaritimeTransport),
90 "2" => Some(TRANSPORT::RailTransport),
91 "3" => Some(TRANSPORT::RoadTransport),
92 "4" => Some(TRANSPORT::AirTransport),
93 "5" => Some(TRANSPORT::Mail),
94 "6" => Some(TRANSPORT::MultimodalTranspo),
95 "7" => Some(TRANSPORT::FixedTransportInstallation),
96 "8" => Some(TRANSPORT::InlandWaterTransport),
97 "9" => Some(TRANSPORT::TransportModeNotApplicable),
98 _ => None,
99 }
100 }
101}