zugferd_code_lists/zugferd_2_3_3/transport.rs
1#![allow(non_camel_case_types)]
2
3#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
4pub enum TRANSPORT {
5 /// Transport mode not specified
6 ///
7 /// 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.
8 TransportModeNotSpecified,
9 /// Maritime transport
10 ///
11 /// Transport of goods and/or persons is by sea.
12 MaritimeTransport,
13 /// Rail transport
14 ///
15 /// Transport of goods and/or persons is by rail.
16 RailTransport,
17 /// Road transport
18 ///
19 /// Transport of goods and/or persons is by road.
20 RoadTransport,
21 /// Air transport
22 ///
23 /// Transport of goods and/or persons is by air.
24 AirTransport,
25 /// Mail
26 ///
27 /// 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.
28 Mail,
29 /// Multimodal transpo
30 ///
31 /// 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).
32 MultimodalTranspo,
33 /// Fixed transport installation
34 ///
35 /// 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.
36 FixedTransportInstallation,
37 /// Inland water transport
38 ///
39 /// Transport of goods and/or persons is by inland water.
40 InlandWaterTransport,
41 /// Transport mode not applicable
42 ///
43 /// The mode of transport is not applicable.
44 TransportModeNotApplicable,
45}
46
47impl crate::Code for TRANSPORT {
48 fn code(self) -> &'static str {
49 match self {
50 TRANSPORT::TransportModeNotSpecified => "0",
51 TRANSPORT::MaritimeTransport => "1",
52 TRANSPORT::RailTransport => "2",
53 TRANSPORT::RoadTransport => "3",
54 TRANSPORT::AirTransport => "4",
55 TRANSPORT::Mail => "5",
56 TRANSPORT::MultimodalTranspo => "6",
57 TRANSPORT::FixedTransportInstallation => "7",
58 TRANSPORT::InlandWaterTransport => "8",
59 TRANSPORT::TransportModeNotApplicable => "9",
60 }
61 }
62}
63
64impl crate::Description for TRANSPORT {
65 fn description(self) -> &'static str {
66 match self {
67 TRANSPORT::TransportModeNotSpecified => "Transport mode not specified",
68 TRANSPORT::MaritimeTransport => "Maritime transport",
69 TRANSPORT::RailTransport => "Rail transport",
70 TRANSPORT::RoadTransport => "Road transport",
71 TRANSPORT::AirTransport => "Air transport",
72 TRANSPORT::Mail => "Mail",
73 TRANSPORT::MultimodalTranspo => "Multimodal transpo",
74 TRANSPORT::FixedTransportInstallation => "Fixed transport installation",
75 TRANSPORT::InlandWaterTransport => "Inland water transport",
76 TRANSPORT::TransportModeNotApplicable => "Transport mode not applicable",
77 }
78 }
79}
80
81impl crate::FromCode for TRANSPORT {
82 fn from_code(code: &str) -> Option<Self>
83 where
84 Self: Sized,
85 {
86 match code {
87 "0" => Some(TRANSPORT::TransportModeNotSpecified),
88 "1" => Some(TRANSPORT::MaritimeTransport),
89 "2" => Some(TRANSPORT::RailTransport),
90 "3" => Some(TRANSPORT::RoadTransport),
91 "4" => Some(TRANSPORT::AirTransport),
92 "5" => Some(TRANSPORT::Mail),
93 "6" => Some(TRANSPORT::MultimodalTranspo),
94 "7" => Some(TRANSPORT::FixedTransportInstallation),
95 "8" => Some(TRANSPORT::InlandWaterTransport),
96 "9" => Some(TRANSPORT::TransportModeNotApplicable),
97 _ => None,
98 }
99 }
100}