Skip to main content

c_its_parser/standards/
extensions.rs

1// Copyright (c) 2026 consider it GmbH
2
3//! Manual implementation of things missing from code generated from ASN.1
4//!
5//! - rasn-compiler v0.14.3 does not generate a way to access named BIT STRING bits
6
7#[repr(u8)]
8#[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
9#[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
10#[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
11/// Enum values for [`MessageId`](`crate::standards::cdd_2_2_1::etsi_its_cdd::MessageId`)
12///
13/// Conversions to and from the ETSI ASN.1 type are provided.
14///
15/// Since `MessageId` doesn't contain a named value for each possible value, rasn can't generate this enum for us
16pub enum ItsMessageId {
17    Denm = 1,
18    Cam = 2,
19    Poi = 3,
20    Spatem = 4,
21    Mapem = 5,
22    Ivim = 6,
23    EvRsr = 7,
24    Tistpgtransaction = 8,
25    Srem = 9,
26    Ssem = 10,
27    Evcsn = 11,
28    Saem = 12,
29    Rtcmem = 13,
30    Cpm = 14,
31    Imzm = 15,
32    Vam = 16,
33    Dsm = 17,
34    Pcim = 18,
35    Pcvm = 19,
36    Mcm = 20,
37    Pam = 21,
38}
39
40impl ItsMessageId {
41    pub fn as_u8(self) -> u8 {
42        self as u8
43    }
44}
45
46#[cfg(feature = "_cdd_2_2_1")]
47macro_rules! itsmessageid_conv {
48    ($t:ty) => {
49        impl From<crate::standards::extensions::ItsMessageId> for $t {
50            fn from(value: crate::standards::extensions::ItsMessageId) -> Self {
51                Self(value as u8)
52            }
53        }
54
55        impl TryInto<crate::standards::extensions::ItsMessageId> for $t {
56            type Error = alloc::string::String;
57
58            fn try_into(self) -> Result<crate::standards::extensions::ItsMessageId, Self::Error> {
59                match self.0 {
60                    1 => Ok(crate::standards::extensions::ItsMessageId::Denm),
61                    2 => Ok(crate::standards::extensions::ItsMessageId::Cam),
62                    3 => Ok(crate::standards::extensions::ItsMessageId::Poi),
63                    4 => Ok(crate::standards::extensions::ItsMessageId::Spatem),
64                    5 => Ok(crate::standards::extensions::ItsMessageId::Mapem),
65                    6 => Ok(crate::standards::extensions::ItsMessageId::Ivim),
66                    7 => Ok(crate::standards::extensions::ItsMessageId::EvRsr),
67                    8 => Ok(crate::standards::extensions::ItsMessageId::Tistpgtransaction),
68                    9 => Ok(crate::standards::extensions::ItsMessageId::Srem),
69                    10 => Ok(crate::standards::extensions::ItsMessageId::Ssem),
70                    11 => Ok(crate::standards::extensions::ItsMessageId::Evcsn),
71                    12 => Ok(crate::standards::extensions::ItsMessageId::Saem),
72                    13 => Ok(crate::standards::extensions::ItsMessageId::Rtcmem),
73                    14 => Ok(crate::standards::extensions::ItsMessageId::Cpm),
74                    15 => Ok(crate::standards::extensions::ItsMessageId::Imzm),
75                    16 => Ok(crate::standards::extensions::ItsMessageId::Vam),
76                    17 => Ok(crate::standards::extensions::ItsMessageId::Dsm),
77                    18 => Ok(crate::standards::extensions::ItsMessageId::Pcim),
78                    19 => Ok(crate::standards::extensions::ItsMessageId::Pcvm),
79                    20 => Ok(crate::standards::extensions::ItsMessageId::Mcm),
80                    21 => Ok(crate::standards::extensions::ItsMessageId::Pam),
81                    _ => Err(alloc::format!("MessageId {} not a known value", self.0)),
82                }
83            }
84        }
85    };
86}
87
88#[repr(u8)]
89#[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
90#[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
91#[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
92/// Enum values for [`CDD 2.2.1 StationType`](`crate::standards::cdd_2_2_1::etsi_its_cdd::StationType`)/ [`CDD 1.3.1 StationType`](`crate::standards::cdd_1_3_1_1::its_container::StationType`)
93///
94/// Conversions to and from the ETSI ASN.1 type are provided.
95///
96/// Since `StationType` doesn't contain a named value for each possible value, rasn can't generate this enum for us
97pub enum ItsStationType {
98    Unknown = 0,
99    Pedestrian = 1,
100    Cyclist = 2,
101    Moped = 3,
102    Motorcycle = 4,
103    Passengercar = 5,
104    Bus = 6,
105    Lighttruck = 7,
106    Heavytruck = 8,
107    Trailer = 9,
108    Specialvehicles = 10,
109    Tram = 11,
110    LightVruVehicle = 12,
111    Animal = 13,
112    Roadsideunit = 15,
113}
114
115impl ItsStationType {
116    pub fn as_u8(self) -> u8 {
117        self as u8
118    }
119}
120
121#[cfg(any(feature = "_cdd_1_3_1_1", feature = "_cdd_2_2_1"))]
122macro_rules! itsstationtype_conv {
123    ($t:ty) => {
124        impl From<crate::standards::extensions::ItsStationType> for $t {
125            fn from(value: crate::standards::extensions::ItsStationType) -> Self {
126                Self(value as u8)
127            }
128        }
129
130        impl TryInto<crate::standards::extensions::ItsStationType> for $t {
131            type Error = alloc::string::String;
132
133            fn try_into(self) -> Result<crate::standards::extensions::ItsStationType, Self::Error> {
134                match self.0 {
135                    0 => Ok(crate::standards::extensions::ItsStationType::Unknown),
136                    1 => Ok(crate::standards::extensions::ItsStationType::Pedestrian),
137                    2 => Ok(crate::standards::extensions::ItsStationType::Cyclist),
138                    3 => Ok(crate::standards::extensions::ItsStationType::Moped),
139                    4 => Ok(crate::standards::extensions::ItsStationType::Motorcycle),
140                    5 => Ok(crate::standards::extensions::ItsStationType::Passengercar),
141                    6 => Ok(crate::standards::extensions::ItsStationType::Bus),
142                    7 => Ok(crate::standards::extensions::ItsStationType::Lighttruck),
143                    8 => Ok(crate::standards::extensions::ItsStationType::Heavytruck),
144                    9 => Ok(crate::standards::extensions::ItsStationType::Trailer),
145                    10 => Ok(crate::standards::extensions::ItsStationType::Specialvehicles),
146                    11 => Ok(crate::standards::extensions::ItsStationType::Tram),
147                    12 => Ok(crate::standards::extensions::ItsStationType::LightVruVehicle),
148                    13 => Ok(crate::standards::extensions::ItsStationType::Animal),
149                    15 => Ok(crate::standards::extensions::ItsStationType::Roadsideunit),
150                    _ => Err(alloc::format!("StationType {} not a known value", self.0)),
151                }
152            }
153        }
154    };
155}
156
157/// DENM Sub Cause Codes
158pub mod its_scc {
159    /// Common conversions for manual ETSI Enums
160    macro_rules! scc_conv_part {
161        ($t:ty, $etsi:ty) => {
162            impl $t {
163                pub fn as_u8(self) -> u8 {
164                    self as u8
165                }
166            }
167
168            impl From<$t> for $etsi {
169                fn from(value: $t) -> Self {
170                    Self(value as u8)
171                }
172            }
173        };
174    }
175
176    /// SCC 1, ASN.1 `TrafficConditionSubCauseCode`
177    #[repr(u8)]
178    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
179    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
180    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
181    pub enum TrafficCondition {
182        Unavailable = 0,
183        IncreasedVolumeOfTraffic = 1,
184        TrafficJamSlowlyIncreasing = 2,
185        TrafficJamIncreasing = 3,
186        TrafficJamStronglyIncreasing = 4,
187        TrafficStationary = 5,
188        TrafficJamSlightlyDecreasing = 6,
189        TrafficJamDecreasing = 7,
190        TrafficJamStronglyDecreasing = 8,
191    }
192    scc_conv_part!(
193        TrafficCondition,
194        crate::standards::cdd_2_2_1::etsi_its_cdd::TrafficConditionSubCauseCode
195    );
196    impl TryInto<TrafficCondition>
197        for crate::standards::cdd_2_2_1::etsi_its_cdd::TrafficConditionSubCauseCode
198    {
199        type Error = alloc::string::String;
200
201        fn try_into(self) -> Result<TrafficCondition, Self::Error> {
202            match self.0 {
203                0 => Ok(TrafficCondition::Unavailable),
204                1 => Ok(TrafficCondition::IncreasedVolumeOfTraffic),
205                2 => Ok(TrafficCondition::TrafficJamSlowlyIncreasing),
206                3 => Ok(TrafficCondition::TrafficJamIncreasing),
207                4 => Ok(TrafficCondition::TrafficJamStronglyIncreasing),
208                5 => Ok(TrafficCondition::TrafficStationary),
209                6 => Ok(TrafficCondition::TrafficJamSlightlyDecreasing),
210                7 => Ok(TrafficCondition::TrafficJamDecreasing),
211                8 => Ok(TrafficCondition::TrafficJamStronglyDecreasing),
212                _ => Err(alloc::format!(
213                    "TrafficConditionSubCauseCode {} not a known value",
214                    self.0
215                )),
216            }
217        }
218    }
219
220    /// SCC 2, ASN.1 `AccidentSubCauseCode`
221    #[repr(u8)]
222    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
223    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
224    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
225    pub enum Accident {
226        Unavailable = 0,
227        MultiVehicleAccident = 1,
228        HeavyAccident = 2,
229        AccidentInvolvingLorry = 3,
230        AccidentInvolvingBus = 4,
231        AccidentInvolvingHazardousMaterials = 5,
232        AccidentOnOppositeLane = 6,
233        UnsecuredAccident = 7,
234        AssistanceRequested = 8,
235    }
236    scc_conv_part!(
237        Accident,
238        crate::standards::cdd_2_2_1::etsi_its_cdd::AccidentSubCauseCode
239    );
240    impl TryInto<Accident> for crate::standards::cdd_2_2_1::etsi_its_cdd::AccidentSubCauseCode {
241        type Error = alloc::string::String;
242
243        fn try_into(self) -> Result<Accident, Self::Error> {
244            match self.0 {
245                0 => Ok(Accident::Unavailable),
246                1 => Ok(Accident::MultiVehicleAccident),
247                2 => Ok(Accident::HeavyAccident),
248                3 => Ok(Accident::AccidentInvolvingLorry),
249                4 => Ok(Accident::AccidentInvolvingBus),
250                5 => Ok(Accident::AccidentInvolvingHazardousMaterials),
251                6 => Ok(Accident::AccidentOnOppositeLane),
252                7 => Ok(Accident::UnsecuredAccident),
253                8 => Ok(Accident::AssistanceRequested),
254                _ => Err(alloc::format!(
255                    "AccidentSubCauseCode {} not a known value",
256                    self.0
257                )),
258            }
259        }
260    }
261
262    /// SCC 3, ASN.1 `RoadworksSubCauseCode`
263    #[repr(u8)]
264    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
265    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
266    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
267    pub enum Roadworks {
268        Unavailable = 0,
269        MajorRoadworks = 1,
270        RoadMarkingWork = 2,
271        SlowMovingRoadMaintenance = 3,
272        ShortTermStationaryRoadworks = 4,
273        StreetCleaning = 5,
274        WinterService = 6,
275    }
276    scc_conv_part!(
277        Roadworks,
278        crate::standards::cdd_2_2_1::etsi_its_cdd::RoadworksSubCauseCode
279    );
280    impl TryInto<Roadworks> for crate::standards::cdd_2_2_1::etsi_its_cdd::RoadworksSubCauseCode {
281        type Error = alloc::string::String;
282
283        fn try_into(self) -> Result<Roadworks, Self::Error> {
284            match self.0 {
285                0 => Ok(Roadworks::Unavailable),
286                1 => Ok(Roadworks::MajorRoadworks),
287                2 => Ok(Roadworks::RoadMarkingWork),
288                3 => Ok(Roadworks::SlowMovingRoadMaintenance),
289                4 => Ok(Roadworks::ShortTermStationaryRoadworks),
290                5 => Ok(Roadworks::StreetCleaning),
291                6 => Ok(Roadworks::WinterService),
292                _ => Err(alloc::format!(
293                    "RoadworksSubCauseCode {} not a known value",
294                    self.0
295                )),
296            }
297        }
298    }
299
300    /// SCC 12, ASN.1 `HumanPresenceOnTheRoadSubCauseCode`
301    #[repr(u8)]
302    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
303    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
304    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
305    pub enum HumanPresenceOnTheRoad {
306        Unavailable = 0,
307        ChildrenOnRoadway = 1,
308        CyclistOnRoadway = 2,
309        MotorcyclistOnRoadway = 3,
310    }
311    scc_conv_part!(
312        HumanPresenceOnTheRoad,
313        crate::standards::cdd_2_2_1::etsi_its_cdd::HumanPresenceOnTheRoadSubCauseCode
314    );
315    impl TryInto<HumanPresenceOnTheRoad>
316        for crate::standards::cdd_2_2_1::etsi_its_cdd::HumanPresenceOnTheRoadSubCauseCode
317    {
318        type Error = alloc::string::String;
319
320        fn try_into(self) -> Result<HumanPresenceOnTheRoad, Self::Error> {
321            match self.0 {
322                0 => Ok(HumanPresenceOnTheRoad::Unavailable),
323                1 => Ok(HumanPresenceOnTheRoad::ChildrenOnRoadway),
324                2 => Ok(HumanPresenceOnTheRoad::CyclistOnRoadway),
325                3 => Ok(HumanPresenceOnTheRoad::MotorcyclistOnRoadway),
326                _ => Err(alloc::format!(
327                    "HumanPresenceOnTheRoadSubCauseCode {} not a known value",
328                    self.0
329                )),
330            }
331        }
332    }
333
334    /// SCC 14, ASN.1 `WrongWayDrivingSubCauseCode`
335    #[repr(u8)]
336    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
337    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
338    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
339    pub enum WrongWayDriving {
340        Unavailable = 0,
341        WrongLane = 1,
342        WrongDirection = 2,
343    }
344    scc_conv_part!(
345        WrongWayDriving,
346        crate::standards::cdd_2_2_1::etsi_its_cdd::WrongWayDrivingSubCauseCode
347    );
348    impl TryInto<WrongWayDriving>
349        for crate::standards::cdd_2_2_1::etsi_its_cdd::WrongWayDrivingSubCauseCode
350    {
351        type Error = alloc::string::String;
352
353        fn try_into(self) -> Result<WrongWayDriving, Self::Error> {
354            match self.0 {
355                0 => Ok(WrongWayDriving::Unavailable),
356                1 => Ok(WrongWayDriving::WrongLane),
357                2 => Ok(WrongWayDriving::WrongDirection),
358                _ => Err(alloc::format!(
359                    "WrongWayDrivingSubCauseCode {} not a known value",
360                    self.0
361                )),
362            }
363        }
364    }
365
366    /// SCC 17, ASN.1 `AdverseWeatherCondition-ExtremeWeatherConditionSubCauseCode`
367    #[repr(u8)]
368    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
369    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
370    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
371    pub enum AdverseWeatherConditionExtremeWeatherCondition {
372        Unavailable = 0,
373        StrongWinds = 1,
374        DamagingHail = 2,
375        Hurricane = 3,
376        Thunderstorm = 4,
377        Tornado = 5,
378        Blizzard = 6,
379    }
380    scc_conv_part!(
381        AdverseWeatherConditionExtremeWeatherCondition,
382        crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionExtremeWeatherConditionSubCauseCode
383    );
384    impl TryInto<AdverseWeatherConditionExtremeWeatherCondition>
385        for crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionExtremeWeatherConditionSubCauseCode
386    {
387        type Error = alloc::string::String;
388
389        fn try_into(self) -> Result<AdverseWeatherConditionExtremeWeatherCondition, Self::Error> {
390            match self.0 {
391                0 => Ok(AdverseWeatherConditionExtremeWeatherCondition::Unavailable),
392                1 => Ok(AdverseWeatherConditionExtremeWeatherCondition::StrongWinds),
393                2 => Ok(AdverseWeatherConditionExtremeWeatherCondition::DamagingHail),
394                3 => Ok(AdverseWeatherConditionExtremeWeatherCondition::Hurricane),
395                4 => Ok(AdverseWeatherConditionExtremeWeatherCondition::Thunderstorm),
396                5 => Ok(AdverseWeatherConditionExtremeWeatherCondition::Tornado),
397                6 => Ok(AdverseWeatherConditionExtremeWeatherCondition::Blizzard),
398                _ => Err(alloc::format!("ExtremeWeatherConditionSubCauseCode {} not a known value", self.0)),
399            }
400        }
401    }
402
403    /// SCC 6, ASN.1 `AdverseWeatherCondition-AdhesionSubCauseCode`
404    #[repr(u8)]
405    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
406    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
407    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
408    pub enum AdverseWeatherConditionAdhesion {
409        Unavailable = 0,
410        HeavyFrostOnRoad = 1,
411        FuelOnRoad = 2,
412        MudOnRoad = 3,
413        SnowOnRoad = 4,
414        IceOnRoad = 5,
415        BlackIceOnRoad = 6,
416        OilOnRoad = 7,
417        LooseChippings = 8,
418        InstantBlackIce = 9,
419        RoadsSalted = 10,
420    }
421    scc_conv_part!(
422        AdverseWeatherConditionAdhesion,
423        crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionAdhesionSubCauseCode
424    );
425    impl TryInto<AdverseWeatherConditionAdhesion>
426        for crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionAdhesionSubCauseCode
427    {
428        type Error = alloc::string::String;
429
430        fn try_into(self) -> Result<AdverseWeatherConditionAdhesion, Self::Error> {
431            match self.0 {
432                0 => Ok(AdverseWeatherConditionAdhesion::Unavailable),
433                1 => Ok(AdverseWeatherConditionAdhesion::HeavyFrostOnRoad),
434                2 => Ok(AdverseWeatherConditionAdhesion::FuelOnRoad),
435                3 => Ok(AdverseWeatherConditionAdhesion::MudOnRoad),
436                4 => Ok(AdverseWeatherConditionAdhesion::SnowOnRoad),
437                5 => Ok(AdverseWeatherConditionAdhesion::IceOnRoad),
438                6 => Ok(AdverseWeatherConditionAdhesion::BlackIceOnRoad),
439                7 => Ok(AdverseWeatherConditionAdhesion::OilOnRoad),
440                8 => Ok(AdverseWeatherConditionAdhesion::LooseChippings),
441                9 => Ok(AdverseWeatherConditionAdhesion::InstantBlackIce),
442                10 => Ok(AdverseWeatherConditionAdhesion::RoadsSalted),
443                _ => Err(alloc::format!(
444                    "AdhesionSubCauseCode {} not a known value",
445                    self.0
446                )),
447            }
448        }
449    }
450
451    /// SCC 18, ASN.1 `AdverseWeatherCondition-VisibilitySubCauseCode`
452    #[repr(u8)]
453    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
454    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
455    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
456    pub enum AdverseWeatherConditionVisibility {
457        Unavailable = 0,
458        Fog = 1,
459        Smoke = 2,
460        HeavySnowfall = 3,
461        HeavyRain = 4,
462        HeavyHail = 5,
463        LowSunGlare = 6,
464        Sandstorms = 7,
465        SwarmsOfInsects = 8,
466    }
467    scc_conv_part!(
468        AdverseWeatherConditionVisibility,
469        crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionVisibilitySubCauseCode
470    );
471    impl TryInto<AdverseWeatherConditionVisibility>
472        for crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionVisibilitySubCauseCode
473    {
474        type Error = alloc::string::String;
475
476        fn try_into(self) -> Result<AdverseWeatherConditionVisibility, Self::Error> {
477            match self.0 {
478                0 => Ok(AdverseWeatherConditionVisibility::Unavailable),
479                1 => Ok(AdverseWeatherConditionVisibility::Fog),
480                2 => Ok(AdverseWeatherConditionVisibility::Smoke),
481                3 => Ok(AdverseWeatherConditionVisibility::HeavySnowfall),
482                4 => Ok(AdverseWeatherConditionVisibility::HeavyRain),
483                5 => Ok(AdverseWeatherConditionVisibility::HeavyHail),
484                6 => Ok(AdverseWeatherConditionVisibility::LowSunGlare),
485                7 => Ok(AdverseWeatherConditionVisibility::Sandstorms),
486                8 => Ok(AdverseWeatherConditionVisibility::SwarmsOfInsects),
487                _ => Err(alloc::format!(
488                    "VisibilitySubCauseCode {} not a known value",
489                    self.0
490                )),
491            }
492        }
493    }
494
495    /// SCC 19, ASN.1 `AdverseWeatherCondition-PrecipitationSubCauseCode`
496    #[repr(u8)]
497    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
498    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
499    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
500    pub enum AdverseWeatherConditionPrecipitation {
501        Unavailable = 0,
502        HeavyRain = 1,
503        HeavySnowfall = 2,
504        SoftHail = 3,
505    }
506    scc_conv_part!(
507        AdverseWeatherConditionPrecipitation,
508        crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionPrecipitationSubCauseCode
509    );
510    impl TryInto<AdverseWeatherConditionPrecipitation>
511        for crate::standards::cdd_2_2_1::etsi_its_cdd::AdverseWeatherConditionPrecipitationSubCauseCode
512    {
513        type Error = alloc::string::String;
514
515        fn try_into(self) -> Result<AdverseWeatherConditionPrecipitation, Self::Error> {
516            match self.0 {
517                0 => Ok(AdverseWeatherConditionPrecipitation::Unavailable),
518                1 => Ok(AdverseWeatherConditionPrecipitation::HeavyRain),
519                2 => Ok(AdverseWeatherConditionPrecipitation::HeavySnowfall),
520                3 => Ok(AdverseWeatherConditionPrecipitation::SoftHail),
521                _ => Err(alloc::format!("PrecipitationSubCauseCode {} not a known value", self.0)),
522            }
523        }
524    }
525
526    /// SCC 26, ASN.1 `SlowVehicleSubCauseCode`
527    #[repr(u8)]
528    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
529    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
530    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
531    pub enum SlowVehicle {
532        Unavailable = 0,
533        MaintenanceVehicle = 1,
534        VehiclesSlowingToLookAtAccident = 2,
535        AbnormalLoad = 3,
536        AbnormalWideLoad = 4,
537        Convoy = 5,
538        Snowplough = 6,
539        Deicing = 7,
540        SaltingVehicles = 8,
541    }
542    scc_conv_part!(
543        SlowVehicle,
544        crate::standards::cdd_2_2_1::etsi_its_cdd::SlowVehicleSubCauseCode
545    );
546    impl TryInto<SlowVehicle> for crate::standards::cdd_2_2_1::etsi_its_cdd::SlowVehicleSubCauseCode {
547        type Error = alloc::string::String;
548
549        fn try_into(self) -> Result<SlowVehicle, Self::Error> {
550            match self.0 {
551                0 => Ok(SlowVehicle::Unavailable),
552                1 => Ok(SlowVehicle::MaintenanceVehicle),
553                2 => Ok(SlowVehicle::VehiclesSlowingToLookAtAccident),
554                3 => Ok(SlowVehicle::AbnormalLoad),
555                4 => Ok(SlowVehicle::AbnormalWideLoad),
556                5 => Ok(SlowVehicle::Convoy),
557                6 => Ok(SlowVehicle::Snowplough),
558                7 => Ok(SlowVehicle::Deicing),
559                8 => Ok(SlowVehicle::SaltingVehicles),
560                _ => Err(alloc::format!(
561                    "SlowVehicleSubCauseCode {} not a known value",
562                    self.0
563                )),
564            }
565        }
566    }
567
568    /// SCC 94, ASN.1 `StationaryVehicleSubCauseCode`
569    #[repr(u8)]
570    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
571    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
572    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
573    pub enum StationaryVehicle {
574        Unavailable = 0,
575        HumanProblem = 1,
576        VehicleBreakdown = 2,
577        PostCrash = 3,
578        PublicTransportStop = 4,
579        CarryingDangerousGoods = 5,
580    }
581    scc_conv_part!(
582        StationaryVehicle,
583        crate::standards::cdd_2_2_1::etsi_its_cdd::StationaryVehicleSubCauseCode
584    );
585    impl TryInto<StationaryVehicle>
586        for crate::standards::cdd_2_2_1::etsi_its_cdd::StationaryVehicleSubCauseCode
587    {
588        type Error = alloc::string::String;
589
590        fn try_into(self) -> Result<StationaryVehicle, Self::Error> {
591            match self.0 {
592                0 => Ok(StationaryVehicle::Unavailable),
593                1 => Ok(StationaryVehicle::HumanProblem),
594                2 => Ok(StationaryVehicle::VehicleBreakdown),
595                3 => Ok(StationaryVehicle::PostCrash),
596                4 => Ok(StationaryVehicle::PublicTransportStop),
597                5 => Ok(StationaryVehicle::CarryingDangerousGoods),
598                _ => Err(alloc::format!(
599                    "StationaryVehicleSubCauseCode {} not a known value",
600                    self.0
601                )),
602            }
603        }
604    }
605
606    /// SCC 93, ASN.1 `HumanProblemSubCauseCode`
607    #[repr(u8)]
608    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
609    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
610    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
611    pub enum HumanProblem {
612        Unavailable = 0,
613        GlycemiaProblem = 1,
614        HeartProblem = 2,
615    }
616    scc_conv_part!(
617        HumanProblem,
618        crate::standards::cdd_2_2_1::etsi_its_cdd::HumanProblemSubCauseCode
619    );
620    impl TryInto<HumanProblem> for crate::standards::cdd_2_2_1::etsi_its_cdd::HumanProblemSubCauseCode {
621        type Error = alloc::string::String;
622
623        fn try_into(self) -> Result<HumanProblem, Self::Error> {
624            match self.0 {
625                0 => Ok(HumanProblem::Unavailable),
626                1 => Ok(HumanProblem::GlycemiaProblem),
627                2 => Ok(HumanProblem::HeartProblem),
628                _ => Err(alloc::format!(
629                    "HumanProblemSubCauseCode {} not a known value",
630                    self.0
631                )),
632            }
633        }
634    }
635
636    /// SCC 95, ASN.1 `EmergencyVehicleApproachingSubCauseCode`
637    #[repr(u8)]
638    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
639    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
640    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
641    pub enum EmergencyVehicleApproaching {
642        Unavailable = 0,
643        EmergencyVehicleApproaching = 1,
644        PrioritizedVehicleApproaching = 2,
645    }
646    scc_conv_part!(
647        EmergencyVehicleApproaching,
648        crate::standards::cdd_2_2_1::etsi_its_cdd::EmergencyVehicleApproachingSubCauseCode
649    );
650    impl TryInto<EmergencyVehicleApproaching>
651        for crate::standards::cdd_2_2_1::etsi_its_cdd::EmergencyVehicleApproachingSubCauseCode
652    {
653        type Error = alloc::string::String;
654
655        fn try_into(self) -> Result<EmergencyVehicleApproaching, Self::Error> {
656            match self.0 {
657                0 => Ok(EmergencyVehicleApproaching::Unavailable),
658                1 => Ok(EmergencyVehicleApproaching::EmergencyVehicleApproaching),
659                2 => Ok(EmergencyVehicleApproaching::PrioritizedVehicleApproaching),
660                _ => Err(alloc::format!(
661                    "EmergencyVehicleApproachingSubCauseCode {} not a known value",
662                    self.0
663                )),
664            }
665        }
666    }
667
668    /// SCC 96, ASN.1 `HazardousLocation-DangerousCurveSubCauseCode`
669    #[repr(u8)]
670    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
671    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
672    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
673    pub enum HazardousLocationDangerousCurve {
674        Unavailable = 0,
675        DangerousLeftTurnCurve = 1,
676        DangerousRightTurnCurve = 2,
677        MultipleCurvesStartingWithUnknownTurningDirection = 3,
678        MultipleCurvesStartingWithLeftTurn = 4,
679        MultipleCurvesStartingWithRightTurn = 5,
680    }
681    scc_conv_part!(
682        HazardousLocationDangerousCurve,
683        crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationDangerousCurveSubCauseCode
684    );
685    impl TryInto<HazardousLocationDangerousCurve>
686        for crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationDangerousCurveSubCauseCode
687    {
688        type Error = alloc::string::String;
689
690        fn try_into(self) -> Result<HazardousLocationDangerousCurve, Self::Error> {
691            match self.0 {
692                0 => Ok(HazardousLocationDangerousCurve::Unavailable),
693                1 => Ok(HazardousLocationDangerousCurve::DangerousLeftTurnCurve),
694                2 => Ok(HazardousLocationDangerousCurve::DangerousRightTurnCurve),
695                3 => Ok(HazardousLocationDangerousCurve::MultipleCurvesStartingWithUnknownTurningDirection),
696                4 => Ok(HazardousLocationDangerousCurve::MultipleCurvesStartingWithLeftTurn),
697                5 => Ok(HazardousLocationDangerousCurve::MultipleCurvesStartingWithRightTurn),
698                _ => Err(alloc::format!("DangerousCurveSubCauseCode {} not a known value", self.0)),
699            }
700        }
701    }
702
703    /// SCC 9, ASN.1 `HazardousLocation-SurfaceConditionSubCauseCode`
704    #[repr(u8)]
705    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
706    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
707    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
708    pub enum HazardousLocationSurfaceCondition {
709        Unavailable = 0,
710        Rockfalls = 1,
711        EarthquakeDamage = 2,
712        SewerCollapse = 3,
713        Subsidence = 4,
714        SnowDrifts = 5,
715        StormDamage = 6,
716        BurstPipe = 7,
717        VolcanoEruption = 8,
718        FallingIce = 9,
719    }
720    scc_conv_part!(
721        HazardousLocationSurfaceCondition,
722        crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationSurfaceConditionSubCauseCode
723    );
724    impl TryInto<HazardousLocationSurfaceCondition>
725        for crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationSurfaceConditionSubCauseCode
726    {
727        type Error = alloc::string::String;
728
729        fn try_into(self) -> Result<HazardousLocationSurfaceCondition, Self::Error> {
730            match self.0 {
731                0 => Ok(HazardousLocationSurfaceCondition::Unavailable),
732                1 => Ok(HazardousLocationSurfaceCondition::Rockfalls),
733                2 => Ok(HazardousLocationSurfaceCondition::EarthquakeDamage),
734                3 => Ok(HazardousLocationSurfaceCondition::SewerCollapse),
735                4 => Ok(HazardousLocationSurfaceCondition::Subsidence),
736                5 => Ok(HazardousLocationSurfaceCondition::SnowDrifts),
737                6 => Ok(HazardousLocationSurfaceCondition::StormDamage),
738                7 => Ok(HazardousLocationSurfaceCondition::BurstPipe),
739                8 => Ok(HazardousLocationSurfaceCondition::VolcanoEruption),
740                9 => Ok(HazardousLocationSurfaceCondition::FallingIce),
741                _ => Err(alloc::format!(
742                    "SurfaceConditionSubCauseCode {} not a known value",
743                    self.0
744                )),
745            }
746        }
747    }
748
749    /// SCC 10, ASN.1 `HazardousLocation-ObstacleOnTheRoadSubCauseCode`
750    #[repr(u8)]
751    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
752    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
753    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
754    pub enum HazardousLocationObstacleOnTheRoad {
755        Unavailable = 0,
756        ShedLoad = 1,
757        PartsOfVehicles = 2,
758        PartsOfTyres = 3,
759        BigObjects = 4,
760        FallenTrees = 5,
761        HubCaps = 6,
762        WaitingVehicles = 7,
763    }
764    scc_conv_part!(
765        HazardousLocationObstacleOnTheRoad,
766        crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationObstacleOnTheRoadSubCauseCode
767    );
768    impl TryInto<HazardousLocationObstacleOnTheRoad>
769        for crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationObstacleOnTheRoadSubCauseCode
770    {
771        type Error = alloc::string::String;
772
773        fn try_into(self) -> Result<HazardousLocationObstacleOnTheRoad, Self::Error> {
774            match self.0 {
775                0 => Ok(HazardousLocationObstacleOnTheRoad::Unavailable),
776                1 => Ok(HazardousLocationObstacleOnTheRoad::ShedLoad),
777                2 => Ok(HazardousLocationObstacleOnTheRoad::PartsOfVehicles),
778                3 => Ok(HazardousLocationObstacleOnTheRoad::PartsOfTyres),
779                4 => Ok(HazardousLocationObstacleOnTheRoad::BigObjects),
780                5 => Ok(HazardousLocationObstacleOnTheRoad::FallenTrees),
781                6 => Ok(HazardousLocationObstacleOnTheRoad::HubCaps),
782                7 => Ok(HazardousLocationObstacleOnTheRoad::WaitingVehicles),
783                _ => Err(alloc::format!("ObstacleOnTheRoadSubCauseCode {} not a known value", self.0)),
784            }
785        }
786    }
787
788    /// SCC 11, ASN.1 `HazardousLocation-AnimalOnTheRoadSubCauseCode`
789    #[repr(u8)]
790    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
791    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
792    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
793    pub enum HazardousLocationAnimalOnTheRoad {
794        Unavailable = 0,
795        WildAnimals = 1,
796        HerdOfAnimals = 2,
797        SmallAnimals = 3,
798        LargeAnimals = 4,
799    }
800    scc_conv_part!(
801        HazardousLocationAnimalOnTheRoad,
802        crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationAnimalOnTheRoadSubCauseCode
803    );
804    impl TryInto<HazardousLocationAnimalOnTheRoad>
805        for crate::standards::cdd_2_2_1::etsi_its_cdd::HazardousLocationAnimalOnTheRoadSubCauseCode
806    {
807        type Error = alloc::string::String;
808
809        fn try_into(self) -> Result<HazardousLocationAnimalOnTheRoad, Self::Error> {
810            match self.0 {
811                0 => Ok(HazardousLocationAnimalOnTheRoad::Unavailable),
812                1 => Ok(HazardousLocationAnimalOnTheRoad::WildAnimals),
813                2 => Ok(HazardousLocationAnimalOnTheRoad::HerdOfAnimals),
814                3 => Ok(HazardousLocationAnimalOnTheRoad::SmallAnimals),
815                4 => Ok(HazardousLocationAnimalOnTheRoad::LargeAnimals),
816                _ => Err(alloc::format!(
817                    "AnimalOnTheRoadSubCauseCode {} not a known value",
818                    self.0
819                )),
820            }
821        }
822    }
823
824    /// SCC 97, ASN.1 `CollisionRiskSubCauseCode`
825    #[repr(u8)]
826    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
827    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
828    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
829    pub enum CollisionRisk {
830        Unavailable = 0,
831        LongitudinalCollisionRisk = 1,
832        CrossingCollisionRisk = 2,
833        LateralCollisionRisk = 3,
834        VulnerableRoadUser = 4,
835    }
836    scc_conv_part!(
837        CollisionRisk,
838        crate::standards::cdd_2_2_1::etsi_its_cdd::CollisionRiskSubCauseCode
839    );
840    impl TryInto<CollisionRisk>
841        for crate::standards::cdd_2_2_1::etsi_its_cdd::CollisionRiskSubCauseCode
842    {
843        type Error = alloc::string::String;
844
845        fn try_into(self) -> Result<CollisionRisk, Self::Error> {
846            match self.0 {
847                0 => Ok(CollisionRisk::Unavailable),
848                1 => Ok(CollisionRisk::LongitudinalCollisionRisk),
849                2 => Ok(CollisionRisk::CrossingCollisionRisk),
850                3 => Ok(CollisionRisk::LateralCollisionRisk),
851                4 => Ok(CollisionRisk::VulnerableRoadUser),
852                _ => Err(alloc::format!(
853                    "CollisionRiskSubCauseCode {} not a known value",
854                    self.0
855                )),
856            }
857        }
858    }
859
860    /// SCC 98, ASN.1 `SignalViolationSubCauseCode`
861    #[repr(u8)]
862    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
863    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
864    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
865    pub enum SignalViolation {
866        Unavailable = 0,
867        StopSignViolation = 1,
868        TrafficLightViolation = 2,
869        TurningRegulationViolation = 3,
870    }
871    scc_conv_part!(
872        SignalViolation,
873        crate::standards::cdd_2_2_1::etsi_its_cdd::SignalViolationSubCauseCode
874    );
875    impl TryInto<SignalViolation>
876        for crate::standards::cdd_2_2_1::etsi_its_cdd::SignalViolationSubCauseCode
877    {
878        type Error = alloc::string::String;
879
880        fn try_into(self) -> Result<SignalViolation, Self::Error> {
881            match self.0 {
882                0 => Ok(SignalViolation::Unavailable),
883                1 => Ok(SignalViolation::StopSignViolation),
884                2 => Ok(SignalViolation::TrafficLightViolation),
885                3 => Ok(SignalViolation::TurningRegulationViolation),
886                _ => Err(alloc::format!(
887                    "SignalViolationSubCauseCode {} not a known value",
888                    self.0
889                )),
890            }
891        }
892    }
893
894    /// SCC 15, ASN.1 `RescueAndRecoveryWorkInProgressSubCauseCode`
895    #[repr(u8)]
896    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
897    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
898    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
899    pub enum RescueAndRecoveryWorkInProgress {
900        Unavailable = 0,
901        EmergencyVehicles = 1,
902        RescueHelicopterLanding = 2,
903        PoliceActivityOngoing = 3,
904        MedicalEmergencyOngoing = 4,
905        ChildAbductionInProgress = 5,
906    }
907    scc_conv_part!(
908        RescueAndRecoveryWorkInProgress,
909        crate::standards::cdd_2_2_1::etsi_its_cdd::RescueAndRecoveryWorkInProgressSubCauseCode
910    );
911    impl TryInto<RescueAndRecoveryWorkInProgress>
912        for crate::standards::cdd_2_2_1::etsi_its_cdd::RescueAndRecoveryWorkInProgressSubCauseCode
913    {
914        type Error = alloc::string::String;
915
916        fn try_into(self) -> Result<RescueAndRecoveryWorkInProgress, Self::Error> {
917            match self.0 {
918                0 => Ok(RescueAndRecoveryWorkInProgress::Unavailable),
919                1 => Ok(RescueAndRecoveryWorkInProgress::EmergencyVehicles),
920                2 => Ok(RescueAndRecoveryWorkInProgress::RescueHelicopterLanding),
921                3 => Ok(RescueAndRecoveryWorkInProgress::PoliceActivityOngoing),
922                4 => Ok(RescueAndRecoveryWorkInProgress::MedicalEmergencyOngoing),
923                5 => Ok(RescueAndRecoveryWorkInProgress::ChildAbductionInProgress),
924                _ => Err(alloc::format!(
925                    "RescueAndRecoveryWorkInProgressSubCauseCode {} not a known value",
926                    self.0
927                )),
928            }
929        }
930    }
931
932    /// SCC 27, ASN.1 `DangerousEndOfQueueSubCauseCode`
933    #[repr(u8)]
934    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
935    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
936    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
937    pub enum DangerousEndOfQueue {
938        Unavailable = 0,
939        SuddenEndOfQueue = 1,
940        QueueOverHill = 2,
941        QueueAroundBend = 3,
942        QueueInTunnel = 4,
943    }
944    scc_conv_part!(
945        DangerousEndOfQueue,
946        crate::standards::cdd_2_2_1::etsi_its_cdd::DangerousEndOfQueueSubCauseCode
947    );
948    impl TryInto<DangerousEndOfQueue>
949        for crate::standards::cdd_2_2_1::etsi_its_cdd::DangerousEndOfQueueSubCauseCode
950    {
951        type Error = alloc::string::String;
952
953        fn try_into(self) -> Result<DangerousEndOfQueue, Self::Error> {
954            match self.0 {
955                0 => Ok(DangerousEndOfQueue::Unavailable),
956                1 => Ok(DangerousEndOfQueue::SuddenEndOfQueue),
957                2 => Ok(DangerousEndOfQueue::QueueOverHill),
958                3 => Ok(DangerousEndOfQueue::QueueAroundBend),
959                4 => Ok(DangerousEndOfQueue::QueueInTunnel),
960                _ => Err(alloc::format!(
961                    "DangerousEndOfQueueSubCauseCode {} not a known value",
962                    self.0
963                )),
964            }
965        }
966    }
967
968    /// SCC 99, ASN.1 `DangerousSituationSubCauseCode`
969    #[repr(u8)]
970    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
971    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
972    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
973    pub enum DangerousSituation {
974        Unavailable = 0,
975        EmergencyElectronicBrakeEngaged = 1,
976        PreCrashSystemEngaged = 2,
977        EspEngaged = 3,
978        AbsEngaged = 4,
979        AebEngaged = 5,
980        BrakeWarningEngaged = 6,
981        CollisionRiskWarningEngaged = 7,
982    }
983    scc_conv_part!(
984        DangerousSituation,
985        crate::standards::cdd_2_2_1::etsi_its_cdd::DangerousSituationSubCauseCode
986    );
987    impl TryInto<DangerousSituation>
988        for crate::standards::cdd_2_2_1::etsi_its_cdd::DangerousSituationSubCauseCode
989    {
990        type Error = alloc::string::String;
991
992        fn try_into(self) -> Result<DangerousSituation, Self::Error> {
993            match self.0 {
994                0 => Ok(DangerousSituation::Unavailable),
995                1 => Ok(DangerousSituation::EmergencyElectronicBrakeEngaged),
996                2 => Ok(DangerousSituation::PreCrashSystemEngaged),
997                3 => Ok(DangerousSituation::EspEngaged),
998                4 => Ok(DangerousSituation::AbsEngaged),
999                5 => Ok(DangerousSituation::AebEngaged),
1000                6 => Ok(DangerousSituation::BrakeWarningEngaged),
1001                7 => Ok(DangerousSituation::CollisionRiskWarningEngaged),
1002                _ => Err(alloc::format!(
1003                    "DangerousSituationSubCauseCode {} not a known value",
1004                    self.0
1005                )),
1006            }
1007        }
1008    }
1009
1010    /// SCC 91, ASN.1 `VehicleBreakdownSubCauseCode`
1011    #[repr(u8)]
1012    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
1013    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
1014    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
1015    pub enum VehicleBreakdown {
1016        Unavailable = 0,
1017        LackOfFuel = 1,
1018        LackOfBatteryPower = 2,
1019        EngineProblem = 3,
1020        TransmissionProblem = 4,
1021        EngineCoolingProblem = 5,
1022        BrakingSystemProblem = 6,
1023        SteeringProblem = 7,
1024        TyrePuncture = 8,
1025        TyrePressureProblem = 9,
1026    }
1027    scc_conv_part!(
1028        VehicleBreakdown,
1029        crate::standards::cdd_2_2_1::etsi_its_cdd::VehicleBreakdownSubCauseCode
1030    );
1031    impl TryInto<VehicleBreakdown>
1032        for crate::standards::cdd_2_2_1::etsi_its_cdd::VehicleBreakdownSubCauseCode
1033    {
1034        type Error = alloc::string::String;
1035
1036        fn try_into(self) -> Result<VehicleBreakdown, Self::Error> {
1037            match self.0 {
1038                0 => Ok(VehicleBreakdown::Unavailable),
1039                1 => Ok(VehicleBreakdown::LackOfFuel),
1040                2 => Ok(VehicleBreakdown::LackOfBatteryPower),
1041                3 => Ok(VehicleBreakdown::EngineProblem),
1042                4 => Ok(VehicleBreakdown::TransmissionProblem),
1043                5 => Ok(VehicleBreakdown::EngineCoolingProblem),
1044                6 => Ok(VehicleBreakdown::BrakingSystemProblem),
1045                7 => Ok(VehicleBreakdown::SteeringProblem),
1046                8 => Ok(VehicleBreakdown::TyrePuncture),
1047                9 => Ok(VehicleBreakdown::TyrePressureProblem),
1048                _ => Err(alloc::format!(
1049                    "VehicleBreakdownSubCauseCode {} not a known value",
1050                    self.0
1051                )),
1052            }
1053        }
1054    }
1055
1056    /// SCC 92, ASN.1 `PostCrashSubCauseCode`
1057    #[repr(u8)]
1058    #[derive(Debug, PartialEq, Clone, Copy, Eq, Hash)]
1059    #[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
1060    #[cfg_attr(feature = "json", serde(rename_all = "lowercase"))]
1061    pub enum PostCrash {
1062        Unavailable = 0,
1063        AccidentWithoutECallTriggered = 1,
1064        AccidentWithECallManuallyTriggered = 2,
1065        AccidentWithECallAutomaticallyTriggered = 3,
1066        AccidentWithECallTriggeredWithoutAccessToCellularNetwork = 4,
1067    }
1068    scc_conv_part!(
1069        PostCrash,
1070        crate::standards::cdd_2_2_1::etsi_its_cdd::PostCrashSubCauseCode
1071    );
1072    impl TryInto<PostCrash> for crate::standards::cdd_2_2_1::etsi_its_cdd::PostCrashSubCauseCode {
1073        type Error = alloc::string::String;
1074
1075        fn try_into(self) -> Result<PostCrash, Self::Error> {
1076            match self.0 {
1077                0 => Ok(PostCrash::Unavailable),
1078                1 => Ok(PostCrash::AccidentWithoutECallTriggered),
1079                2 => Ok(PostCrash::AccidentWithECallManuallyTriggered),
1080                3 => Ok(PostCrash::AccidentWithECallAutomaticallyTriggered),
1081                4 => Ok(PostCrash::AccidentWithECallTriggeredWithoutAccessToCellularNetwork),
1082                _ => Err(alloc::format!(
1083                    "PostCrashSubCauseCode {} not a known value",
1084                    self.0
1085                )),
1086            }
1087        }
1088    }
1089}
1090
1091#[cfg(feature = "_cdd_1_3_1_1")]
1092/// Implementation of additional getters and setters for BITSTRING types with named bits
1093///
1094/// See individual types for available methods:
1095///
1096/// - [`AccelerationControl`](`crate::standards::cdd_1_3_1_1::its_container::AccelerationControl`)
1097/// - [`EmergencyPriority`](`crate::standards::cdd_1_3_1_1::its_container::EmergencyPriority`)
1098/// - [`ExteriorLights`](`crate::standards::cdd_1_3_1_1::its_container::ExteriorLights`)
1099/// - [`LightBarSirenInUse`](`crate::standards::cdd_1_3_1_1::its_container::LightBarSirenInUse`)
1100/// - [`SpecialTransportType`](`crate::standards::cdd_1_3_1_1::its_container::SpecialTransportType`)
1101pub mod cdd_1_3_1_1 {
1102    use crate::standards::cdd_1_3_1_1::its_container::{
1103        AccelerationControl,
1104        EmergencyPriority,
1105        ExteriorLights,
1106        LightBarSirenInUse,
1107        SpecialTransportType,
1108    };
1109
1110    // used in CAM 1.4.1 via BasicVehicleContainerHighFrequency
1111    impl Default for AccelerationControl {
1112        fn default() -> Self {
1113            Self(Default::default())
1114        }
1115    }
1116    impl AccelerationControl {
1117        pub fn get_brake_pedal_engaged(&self) -> bool {
1118            self.0[0]
1119        }
1120        pub fn get_gas_pedal_engaged(&self) -> bool {
1121            self.0[1]
1122        }
1123        pub fn get_emergency_brake_engaged(&self) -> bool {
1124            self.0[2]
1125        }
1126        pub fn get_collision_warning_engaged(&self) -> bool {
1127            self.0[3]
1128        }
1129        pub fn get_acc_engaged(&self) -> bool {
1130            self.0[4]
1131        }
1132        pub fn get_cruise_control_engaged(&self) -> bool {
1133            self.0[5]
1134        }
1135        pub fn get_speed_limiter_engaged(&self) -> bool {
1136            self.0[6]
1137        }
1138
1139        pub fn set_brake_pedal_engaged(&mut self, value: bool) {
1140            self.0.set(0, value)
1141        }
1142        pub fn set_gas_pedal_engaged(&mut self, value: bool) {
1143            self.0.set(1, value)
1144        }
1145        pub fn set_emergency_brake_engaged(&mut self, value: bool) {
1146            self.0.set(2, value)
1147        }
1148        pub fn set_collision_warning_engaged(&mut self, value: bool) {
1149            self.0.set(3, value)
1150        }
1151        pub fn set_acc_engaged(&mut self, value: bool) {
1152            self.0.set(4, value)
1153        }
1154        pub fn set_cruise_control_engaged(&mut self, value: bool) {
1155            self.0.set(5, value)
1156        }
1157        pub fn set_speed_limiter_engaged(&mut self, value: bool) {
1158            self.0.set(6, value)
1159        }
1160    }
1161    impl core::fmt::Display for AccelerationControl {
1162        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1163            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
1164
1165            if self.get_brake_pedal_engaged() {
1166                items.push("brakePedalEngaged: 1".into());
1167            }
1168            if self.get_gas_pedal_engaged() {
1169                items.push("gasPedalEngaged: 1".into());
1170            }
1171            if self.get_emergency_brake_engaged() {
1172                items.push("emergencyBrakeEngaged: 1".into());
1173            }
1174            if self.get_collision_warning_engaged() {
1175                items.push("collisionWarningEngaged: 1".into());
1176            }
1177            if self.get_acc_engaged() {
1178                items.push("accEngaged: 1".into());
1179            }
1180            if self.get_cruise_control_engaged() {
1181                items.push("cruiseControlEngaged: 1".into());
1182            }
1183            if self.get_speed_limiter_engaged() {
1184                items.push("speedLimiterEngaged: 1".into());
1185            }
1186
1187            write!(f, "{}", items.join(", "))
1188        }
1189    }
1190
1191    // used in CAM 1.4.1 via BasicVehicleContainerLowFrequency
1192    impl Default for ExteriorLights {
1193        fn default() -> Self {
1194            Self(Default::default())
1195        }
1196    }
1197    impl ExteriorLights {
1198        pub fn get_low_beam_headlights_on(&self) -> bool {
1199            self.0[0]
1200        }
1201        pub fn get_high_beam_headlights_on(&self) -> bool {
1202            self.0[1]
1203        }
1204        pub fn get_left_turn_signal_on(&self) -> bool {
1205            self.0[2]
1206        }
1207        pub fn get_right_turn_signal_on(&self) -> bool {
1208            self.0[3]
1209        }
1210        pub fn get_daytime_running_lights_on(&self) -> bool {
1211            self.0[4]
1212        }
1213        pub fn get_reverse_light_on(&self) -> bool {
1214            self.0[5]
1215        }
1216        pub fn get_fog_light_on(&self) -> bool {
1217            self.0[6]
1218        }
1219        pub fn get_parking_lights_on(&self) -> bool {
1220            self.0[7]
1221        }
1222
1223        pub fn set_low_beam_headlights_on(&mut self, value: bool) {
1224            self.0.set(0, value)
1225        }
1226        pub fn set_high_beam_headlights_on(&mut self, value: bool) {
1227            self.0.set(1, value)
1228        }
1229        pub fn set_left_turn_signal_on(&mut self, value: bool) {
1230            self.0.set(2, value)
1231        }
1232        pub fn set_right_turn_signal_on(&mut self, value: bool) {
1233            self.0.set(3, value)
1234        }
1235        pub fn set_daytime_running_lights_on(&mut self, value: bool) {
1236            self.0.set(4, value)
1237        }
1238        pub fn set_reverse_light_on(&mut self, value: bool) {
1239            self.0.set(5, value)
1240        }
1241        pub fn set_fog_light_on(&mut self, value: bool) {
1242            self.0.set(6, value)
1243        }
1244        pub fn set_parking_lights_on(&mut self, value: bool) {
1245            self.0.set(7, value)
1246        }
1247    }
1248    impl core::fmt::Display for ExteriorLights {
1249        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1250            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
1251
1252            if self.get_low_beam_headlights_on() {
1253                items.push("lowBeamHeadlightsOn: 1".into());
1254            }
1255            if self.get_high_beam_headlights_on() {
1256                items.push("highBeamHeadlightsOn: 1".into());
1257            }
1258            if self.get_left_turn_signal_on() {
1259                items.push("leftTurnSignalOn: 1".into());
1260            }
1261            if self.get_right_turn_signal_on() {
1262                items.push("rightTurnSignalOn: 1".into());
1263            }
1264            if self.get_daytime_running_lights_on() {
1265                items.push("daytimeRunningLightsOn: 1".into());
1266            }
1267            if self.get_reverse_light_on() {
1268                items.push("reverseLightOn: 1".into());
1269            }
1270            if self.get_fog_light_on() {
1271                items.push("fogLightOn: 1".into());
1272            }
1273            if self.get_parking_lights_on() {
1274                items.push("parkingLightsOn: 1".into());
1275            }
1276
1277            write!(f, "{}", items.join(", "))
1278        }
1279    }
1280
1281    // used in CAM 1.4.1 via SpecialVehicleContainer -> EmergencyContainer
1282    impl Default for EmergencyPriority {
1283        fn default() -> Self {
1284            Self(Default::default())
1285        }
1286    }
1287    impl EmergencyPriority {
1288        pub fn get_request_for_right_of_way(&self) -> bool {
1289            self.0[0]
1290        }
1291        pub fn get_request_for_free_crossing_at_atraffic_light(&self) -> bool {
1292            self.0[1]
1293        }
1294
1295        pub fn set_request_for_right_of_way(&mut self, value: bool) {
1296            self.0.set(0, value)
1297        }
1298        pub fn set_request_for_free_crossing_at_atraffic_light(&mut self, value: bool) {
1299            self.0.set(1, value)
1300        }
1301    }
1302    impl core::fmt::Display for EmergencyPriority {
1303        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1304            write!(
1305                f,
1306                "requestForRightOfWay: {}, requestForFreeCrossingAtATrafficLight: {}",
1307                self.get_request_for_right_of_way(),
1308                self.get_request_for_free_crossing_at_atraffic_light()
1309            )
1310        }
1311    }
1312
1313    // used in CAM 1.4.1 via SpecialVehicleContainer -> (multiple containers)
1314    impl Default for LightBarSirenInUse {
1315        fn default() -> Self {
1316            Self(Default::default())
1317        }
1318    }
1319    impl LightBarSirenInUse {
1320        pub fn get_light_bar_activated(&self) -> bool {
1321            self.0[0]
1322        }
1323        pub fn get_siren_activated(&self) -> bool {
1324            self.0[1]
1325        }
1326
1327        pub fn set_light_bar_activated(&mut self, value: bool) {
1328            self.0.set(0, value)
1329        }
1330        pub fn set_siren_activated(&mut self, value: bool) {
1331            self.0.set(1, value)
1332        }
1333    }
1334    impl core::fmt::Display for LightBarSirenInUse {
1335        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1336            write!(
1337                f,
1338                "lightBarActivated: {}, sirenActivated: {}",
1339                self.get_light_bar_activated(),
1340                self.get_siren_activated()
1341            )
1342        }
1343    }
1344
1345    // used in CAM 1.4.1 via SpecialVehicleContainer -> SpecialTransportContainer
1346    impl Default for SpecialTransportType {
1347        fn default() -> Self {
1348            Self(Default::default())
1349        }
1350    }
1351    impl SpecialTransportType {
1352        pub fn get_heavy_load(&self) -> bool {
1353            self.0[0]
1354        }
1355        pub fn get_excess_width(&self) -> bool {
1356            self.0[1]
1357        }
1358        pub fn get_excess_length(&self) -> bool {
1359            self.0[2]
1360        }
1361        pub fn get_excess_height(&self) -> bool {
1362            self.0[3]
1363        }
1364
1365        pub fn set_heavy_load(&mut self, value: bool) {
1366            self.0.set(0, value)
1367        }
1368        pub fn set_excess_width(&mut self, value: bool) {
1369            self.0.set(1, value)
1370        }
1371        pub fn set_excess_length(&mut self, value: bool) {
1372            self.0.set(2, value)
1373        }
1374        pub fn set_excess_height(&mut self, value: bool) {
1375            self.0.set(3, value)
1376        }
1377    }
1378    impl core::fmt::Display for SpecialTransportType {
1379        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1380            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
1381
1382            if self.get_heavy_load() {
1383                items.push("heavyLoad: 1".into());
1384            }
1385            if self.get_excess_width() {
1386                items.push("excessWidth: 1".into());
1387            }
1388            if self.get_excess_length() {
1389                items.push("excessLength: 1".into());
1390            }
1391            if self.get_excess_height() {
1392                items.push("excessHeight: 1".into());
1393            }
1394
1395            write!(f, "{}", items.join(", "))
1396        }
1397    }
1398
1399    itsstationtype_conv!(crate::standards::cdd_1_3_1_1::its_container::StationType);
1400}
1401
1402#[cfg(feature = "_cdd_2_2_1")]
1403/// Implementation of additional getters and setters for BITSTRING types with named bits
1404///
1405/// See individual types for available methods:
1406///
1407/// - [`EnergyStorageType`](`crate::standards::cdd_1_3_1_1::its_container::EnergyStorageType`)
1408pub mod cdd_2_2_1 {
1409    use crate::standards::cdd_2_2_1::etsi_its_cdd::EnergyStorageType;
1410
1411    impl Default for EnergyStorageType {
1412        fn default() -> Self {
1413            Self(Default::default())
1414        }
1415    }
1416    impl EnergyStorageType {
1417        pub fn get_hydrogen_storage(&self) -> bool {
1418            self.0[0]
1419        }
1420        pub fn get_electric_energy_storage(&self) -> bool {
1421            self.0[1]
1422        }
1423        pub fn get_liquid_propane_gas(&self) -> bool {
1424            self.0[2]
1425        }
1426        pub fn get_compressed_natural_gas(&self) -> bool {
1427            self.0[3]
1428        }
1429        pub fn get_diesel(&self) -> bool {
1430            self.0[4]
1431        }
1432        pub fn get_gasoline(&self) -> bool {
1433            self.0[5]
1434        }
1435        pub fn get_ammonia(&self) -> bool {
1436            self.0[6]
1437        }
1438
1439        pub fn set_hydrogen_storage(&mut self, value: bool) {
1440            self.0.set(0, value)
1441        }
1442        pub fn set_electric_energy_storage(&mut self, value: bool) {
1443            self.0.set(1, value)
1444        }
1445        pub fn set_liquid_propane_gas(&mut self, value: bool) {
1446            self.0.set(2, value)
1447        }
1448        pub fn set_compressed_natural_gas(&mut self, value: bool) {
1449            self.0.set(3, value)
1450        }
1451        pub fn set_diesel(&mut self, value: bool) {
1452            self.0.set(4, value)
1453        }
1454        pub fn set_gasoline(&mut self, value: bool) {
1455            self.0.set(5, value)
1456        }
1457        pub fn set_ammonia(&mut self, value: bool) {
1458            self.0.set(6, value)
1459        }
1460    }
1461    impl core::fmt::Display for EnergyStorageType {
1462        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1463            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
1464
1465            if self.get_hydrogen_storage() {
1466                items.push("hydrogenStorage: 1".into());
1467            }
1468            if self.get_electric_energy_storage() {
1469                items.push("electricEnergyStorage: 1".into());
1470            }
1471            if self.get_liquid_propane_gas() {
1472                items.push("liquidPropaneGas: 1".into());
1473            }
1474            if self.get_compressed_natural_gas() {
1475                items.push("compressedNaturalGas: 1".into());
1476            }
1477            if self.get_diesel() {
1478                items.push("diesel: 1".into());
1479            }
1480            if self.get_gasoline() {
1481                items.push("gasoline: 1".into());
1482            }
1483            if self.get_ammonia() {
1484                items.push("ammonia: 1".into());
1485            }
1486
1487            write!(f, "{}", items.join(", "))
1488        }
1489    }
1490
1491    itsmessageid_conv!(crate::standards::cdd_2_2_1::etsi_its_cdd::MessageId);
1492
1493    itsstationtype_conv!(crate::standards::cdd_2_2_1::etsi_its_cdd::StationType);
1494}
1495
1496#[cfg(feature = "_dsrc_2_2_1")]
1497/// Implementation of additional getters and setters for BITSTRING types with named bits
1498///
1499/// See individual types for available methods:
1500///
1501/// - [`AllowedManeuvers`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::AllowedManeuvers`)
1502/// - [`IntersectionStatusObject`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::IntersectionStatusObject`)
1503/// - [`LaneAttributes`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributes`)
1504/// - [`LaneAttributesBarrier`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesBarrier`)
1505/// - [`LaneAttributesBike`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesBike`)
1506/// - [`LaneAttributesCrosswalk`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesCrosswalk`)
1507/// - [`LaneAttributesParking`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesParking`)
1508/// - [`LaneAttributesSidewalk`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesSidewalk`)
1509/// - [`LaneAttributesStriping`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesStriping`)
1510/// - [`LaneAttributesTrackedVehicle`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesTrackedVehicle`)
1511/// - [`LaneAttributesVehicle`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneAttributesVehicle`)
1512/// - [`LaneDirection`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneDirection`)
1513/// - [`LaneSharing`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneSharing`)
1514/// - [`LaneTypeAttributes`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::LaneTypeAttributes`)
1515/// - [`OcitRequestorDescriptionContainer`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::OcitRequestorDescriptionContainer`)
1516/// - [`TransitVehicleStatus`](`crate::standards::dsrc_2_2_1::etsi_its_dsrc::TransitVehicleStatus`)
1517pub mod dsrc_2_2_1 {
1518    use rasn::types::Ia5String;
1519
1520    use crate::standards::dsrc_2_2_1::etsi_its_dsrc::{
1521        AllowedManeuvers,
1522        IntersectionStatusObject,
1523        LaneAttributes,
1524        LaneAttributesBarrier,
1525        LaneAttributesBike,
1526        LaneAttributesCrosswalk,
1527        LaneAttributesParking,
1528        LaneAttributesSidewalk,
1529        LaneAttributesStriping,
1530        LaneAttributesTrackedVehicle,
1531        LaneAttributesVehicle,
1532        LaneDirection,
1533        LaneSharing,
1534        LaneTypeAttributes,
1535        OcitRequestorDescriptionContainer,
1536        TransitVehicleStatus,
1537    };
1538
1539    // MAPEM/ SPATEM
1540
1541    impl core::fmt::Display for LaneAttributes {
1542        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1543            write!(
1544                f,
1545                "LaneTypeAttributes{{{}}}, LaneDirection{{{}}}, LaneSharing{{{}}}",
1546                self.lane_type, self.directional_use, self.shared_with
1547            )
1548            // regional value left out for now
1549        }
1550    }
1551
1552    impl core::fmt::Display for LaneTypeAttributes {
1553        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1554            match self {
1555                LaneTypeAttributes::vehicle(attrs) => write!(f, "vehicle({attrs})"),
1556                LaneTypeAttributes::crosswalk(attrs) => write!(f, "crosswalk({attrs})"),
1557                LaneTypeAttributes::bikeLane(attrs) => write!(f, "bikeLane({attrs})"),
1558                LaneTypeAttributes::sidewalk(attrs) => write!(f, "sidewalk({attrs})"),
1559                LaneTypeAttributes::median(attrs) => write!(f, "median({attrs})"),
1560                LaneTypeAttributes::striping(attrs) => write!(f, "striping({attrs})"),
1561                LaneTypeAttributes::trackedVehicle(attrs) => write!(f, "trackedVehicle({attrs})"),
1562                LaneTypeAttributes::parking(attrs) => write!(f, "parking({attrs})"),
1563            }
1564        }
1565    }
1566
1567    impl Default for LaneSharing {
1568        fn default() -> Self {
1569            Self(Default::default())
1570        }
1571    }
1572    impl LaneSharing {
1573        pub fn get_overlapping_lane_description_provided(&self) -> bool {
1574            self.0[0]
1575        }
1576        pub fn get_multiple_lanes_treated_as_one_lane(&self) -> bool {
1577            self.0[1]
1578        }
1579        pub fn get_other_non_motorized_traffic_types(&self) -> bool {
1580            self.0[2]
1581        }
1582        pub fn get_individual_motorized_vehicle_traffic(&self) -> bool {
1583            self.0[3]
1584        }
1585        pub fn get_bus_vehicle_traffic(&self) -> bool {
1586            self.0[4]
1587        }
1588        pub fn get_taxi_vehicle_traffic(&self) -> bool {
1589            self.0[5]
1590        }
1591        pub fn get_pedestrians_traffic(&self) -> bool {
1592            self.0[6]
1593        }
1594        pub fn get_cyclist_vehicle_traffic(&self) -> bool {
1595            self.0[7]
1596        }
1597        pub fn get_tracked_vehicle_traffic(&self) -> bool {
1598            self.0[8]
1599        }
1600        pub fn get_pedestrian_traffic(&self) -> bool {
1601            self.0[9]
1602        }
1603
1604        pub fn set_overlapping_lane_description_provided(&mut self, value: bool) {
1605            self.0.set(0, value)
1606        }
1607        pub fn set_multiple_lanes_treated_as_one_lane(&mut self, value: bool) {
1608            self.0.set(1, value)
1609        }
1610        pub fn set_other_non_motorized_traffic_types(&mut self, value: bool) {
1611            self.0.set(2, value)
1612        }
1613        pub fn set_individual_motorized_vehicle_traffic(&mut self, value: bool) {
1614            self.0.set(3, value)
1615        }
1616        pub fn set_bus_vehicle_traffic(&mut self, value: bool) {
1617            self.0.set(4, value)
1618        }
1619        pub fn set_taxi_vehicle_traffic(&mut self, value: bool) {
1620            self.0.set(5, value)
1621        }
1622        pub fn set_pedestrians_traffic(&mut self, value: bool) {
1623            self.0.set(6, value)
1624        }
1625        pub fn set_cyclist_vehicle_traffic(&mut self, value: bool) {
1626            self.0.set(7, value)
1627        }
1628        pub fn set_tracked_vehicle_traffic(&mut self, value: bool) {
1629            self.0.set(8, value)
1630        }
1631        pub fn set_pedestrian_traffic(&mut self, value: bool) {
1632            self.0.set(9, value)
1633        }
1634    }
1635    impl core::fmt::Display for LaneSharing {
1636        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1637            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
1638
1639            if self.get_overlapping_lane_description_provided() {
1640                items.push("overlappingLaneDescriptionProvided: 1".into());
1641            }
1642            if self.get_multiple_lanes_treated_as_one_lane() {
1643                items.push("multipleLanesTreatedAsOneLane: 1".into());
1644            }
1645            if self.get_other_non_motorized_traffic_types() {
1646                items.push("otherNonMotorizedTrafficTypes: 1".into());
1647            }
1648            if self.get_individual_motorized_vehicle_traffic() {
1649                items.push("individualMotorizedVehicleTraffic: 1".into());
1650            }
1651            if self.get_bus_vehicle_traffic() {
1652                items.push("busVehicleTraffic: 1".into());
1653            }
1654            if self.get_taxi_vehicle_traffic() {
1655                items.push("taxiVehicleTraffic: 1".into());
1656            }
1657            if self.get_pedestrians_traffic() {
1658                items.push("pedestriansTraffic: 1".into());
1659            }
1660            if self.get_cyclist_vehicle_traffic() {
1661                items.push("cyclistVehicleTraffic: 1".into());
1662            }
1663            if self.get_tracked_vehicle_traffic() {
1664                items.push("trackedVehicleTraffic: 1".into());
1665            }
1666            if self.get_pedestrian_traffic() {
1667                items.push("pedestrianTraffic: 1".into());
1668            }
1669
1670            write!(f, "{}", items.join(", "))
1671        }
1672    }
1673
1674    impl Default for AllowedManeuvers {
1675        fn default() -> Self {
1676            Self(Default::default())
1677        }
1678    }
1679    impl AllowedManeuvers {
1680        pub fn get_maneuver_straight_allowed(&self) -> bool {
1681            self.0[0]
1682        }
1683        pub fn get_maneuver_left_allowed(&self) -> bool {
1684            self.0[1]
1685        }
1686        pub fn get_maneuver_right_allowed(&self) -> bool {
1687            self.0[2]
1688        }
1689        pub fn get_maneuver_uturn_allowed(&self) -> bool {
1690            self.0[3]
1691        }
1692        pub fn get_maneuver_left_turn_on_red_allowed(&self) -> bool {
1693            self.0[4]
1694        }
1695        pub fn get_maneuver_right_turn_on_red_allowed(&self) -> bool {
1696            self.0[5]
1697        }
1698        pub fn get_maneuver_lane_change_allowed(&self) -> bool {
1699            self.0[6]
1700        }
1701        pub fn get_maneuver_no_stopping_allowed(&self) -> bool {
1702            self.0[7]
1703        }
1704        pub fn get_yield_allways_required(&self) -> bool {
1705            self.0[8]
1706        }
1707        pub fn get_go_with_halt(&self) -> bool {
1708            self.0[9]
1709        }
1710        pub fn get_caution(&self) -> bool {
1711            self.0[10]
1712        }
1713        pub fn get_reserved1(&self) -> bool {
1714            self.0[11]
1715        }
1716
1717        pub fn set_maneuver_straight_allowed(&mut self, value: bool) {
1718            self.0.set(0, value)
1719        }
1720        pub fn set_maneuver_left_allowed(&mut self, value: bool) {
1721            self.0.set(1, value)
1722        }
1723        pub fn set_maneuver_right_allowed(&mut self, value: bool) {
1724            self.0.set(2, value)
1725        }
1726        pub fn set_maneuver_uturn_allowed(&mut self, value: bool) {
1727            self.0.set(3, value)
1728        }
1729        pub fn set_maneuver_left_turn_on_red_allowed(&mut self, value: bool) {
1730            self.0.set(4, value)
1731        }
1732        pub fn set_maneuver_right_turn_on_red_allowed(&mut self, value: bool) {
1733            self.0.set(5, value)
1734        }
1735        pub fn set_maneuver_lane_change_allowed(&mut self, value: bool) {
1736            self.0.set(6, value)
1737        }
1738        pub fn set_maneuver_no_stopping_allowed(&mut self, value: bool) {
1739            self.0.set(7, value)
1740        }
1741        pub fn set_yield_allways_required(&mut self, value: bool) {
1742            self.0.set(8, value)
1743        }
1744        pub fn set_go_with_halt(&mut self, value: bool) {
1745            self.0.set(9, value)
1746        }
1747        pub fn set_caution(&mut self, value: bool) {
1748            self.0.set(10, value)
1749        }
1750        pub fn set_reserved1(&mut self, value: bool) {
1751            self.0.set(11, value)
1752        }
1753    }
1754    impl core::fmt::Display for AllowedManeuvers {
1755        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1756            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
1757
1758            if self.get_maneuver_straight_allowed() {
1759                items.push("maneuverStraightAllowed: 1".into());
1760            }
1761            if self.get_maneuver_left_allowed() {
1762                items.push("maneuverLeftAllowed: 1".into());
1763            }
1764            if self.get_maneuver_right_allowed() {
1765                items.push("maneuverRightAllowed: 1".into());
1766            }
1767            if self.get_maneuver_uturn_allowed() {
1768                items.push("maneuverUTurnAllowed: 1".into());
1769            }
1770            if self.get_maneuver_left_turn_on_red_allowed() {
1771                items.push("maneuverLeftTurnOnRedAllowed: 1".into());
1772            }
1773            if self.get_maneuver_right_turn_on_red_allowed() {
1774                items.push("maneuverRightTurnOnRedAllowed: 1".into());
1775            }
1776            if self.get_maneuver_lane_change_allowed() {
1777                items.push("maneuverLaneChangeAllowed: 1".into());
1778            }
1779            if self.get_maneuver_no_stopping_allowed() {
1780                items.push("maneuverNoStoppingAllowed: 1".into());
1781            }
1782            if self.get_yield_allways_required() {
1783                items.push("yieldAllwaysRequired: 1".into());
1784            }
1785            if self.get_go_with_halt() {
1786                items.push("goWithHalt: 1".into());
1787            }
1788            if self.get_caution() {
1789                items.push("caution: 1".into());
1790            }
1791            if self.get_reserved1() {
1792                items.push("reserved1: 1".into());
1793            }
1794
1795            write!(f, "{}", items.join(", "))
1796        }
1797    }
1798
1799    impl Default for IntersectionStatusObject {
1800        fn default() -> Self {
1801            Self(Default::default())
1802        }
1803    }
1804    impl IntersectionStatusObject {
1805        pub fn get_manual_control_is_enabled(&self) -> bool {
1806            self.0[0]
1807        }
1808        pub fn get_stop_time_is_activated(&self) -> bool {
1809            self.0[1]
1810        }
1811        pub fn get_failure_flash(&self) -> bool {
1812            self.0[2]
1813        }
1814        pub fn get_preempt_is_active(&self) -> bool {
1815            self.0[3]
1816        }
1817        pub fn get_signal_priority_is_active(&self) -> bool {
1818            self.0[4]
1819        }
1820        pub fn get_fixed_time_operation(&self) -> bool {
1821            self.0[5]
1822        }
1823        pub fn get_traffic_dependent_operation(&self) -> bool {
1824            self.0[6]
1825        }
1826        pub fn get_standby_operation(&self) -> bool {
1827            self.0[7]
1828        }
1829        pub fn get_failure_mode(&self) -> bool {
1830            self.0[8]
1831        }
1832        pub fn get_off(&self) -> bool {
1833            self.0[9]
1834        }
1835        pub fn get_recent_map_message_update(&self) -> bool {
1836            self.0[10]
1837        }
1838        pub fn get_recent_change_in_map_assigned_lanes_ids_used(&self) -> bool {
1839            self.0[11]
1840        }
1841        pub fn get_no_valid_map_is_available_at_this_time(&self) -> bool {
1842            self.0[12]
1843        }
1844        pub fn get_no_valid_spat_is_available_at_this_time(&self) -> bool {
1845            self.0[13]
1846        }
1847
1848        pub fn set_manual_control_is_enabled(&mut self, value: bool) {
1849            self.0.set(0, value)
1850        }
1851        pub fn set_stop_time_is_activated(&mut self, value: bool) {
1852            self.0.set(1, value)
1853        }
1854        pub fn set_failure_flash(&mut self, value: bool) {
1855            self.0.set(2, value)
1856        }
1857        pub fn set_preempt_is_active(&mut self, value: bool) {
1858            self.0.set(3, value)
1859        }
1860        pub fn set_signal_priority_is_active(&mut self, value: bool) {
1861            self.0.set(4, value)
1862        }
1863        pub fn set_fixed_time_operation(&mut self, value: bool) {
1864            self.0.set(5, value)
1865        }
1866        pub fn set_traffic_dependent_operation(&mut self, value: bool) {
1867            self.0.set(6, value)
1868        }
1869        pub fn set_standby_operation(&mut self, value: bool) {
1870            self.0.set(7, value)
1871        }
1872        pub fn set_failure_mode(&mut self, value: bool) {
1873            self.0.set(8, value)
1874        }
1875        pub fn set_off(&mut self, value: bool) {
1876            self.0.set(9, value)
1877        }
1878        pub fn set_recent_map_message_update(&mut self, value: bool) {
1879            self.0.set(10, value)
1880        }
1881        pub fn set_recent_change_in_map_assigned_lanes_ids_used(&mut self, value: bool) {
1882            self.0.set(11, value)
1883        }
1884        pub fn set_no_valid_map_is_available_at_this_time(&mut self, value: bool) {
1885            self.0.set(12, value)
1886        }
1887        pub fn set_no_valid_spat_is_available_at_this_time(&mut self, value: bool) {
1888            self.0.set(13, value)
1889        }
1890    }
1891    impl core::fmt::Display for IntersectionStatusObject {
1892        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1893            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
1894
1895            if self.get_manual_control_is_enabled() {
1896                items.push("manualControlIsEnabled: 1".into());
1897            }
1898            if self.get_stop_time_is_activated() {
1899                items.push("stopTimeIsActivated: 1".into());
1900            }
1901            if self.get_failure_flash() {
1902                items.push("failureFlash: 1".into());
1903            }
1904            if self.get_preempt_is_active() {
1905                items.push("preemptIsActive: 1".into());
1906            }
1907            if self.get_signal_priority_is_active() {
1908                items.push("signalPriorityIsActive: 1".into());
1909            }
1910            if self.get_fixed_time_operation() {
1911                items.push("fixedTimeOperation: 1".into());
1912            }
1913            if self.get_traffic_dependent_operation() {
1914                items.push("trafficDependentOperation: 1".into());
1915            }
1916            if self.get_standby_operation() {
1917                items.push("standbyOperation: 1".into());
1918            }
1919            if self.get_failure_mode() {
1920                items.push("failureMode: 1".into());
1921            }
1922            if self.get_off() {
1923                items.push("off: 1".into());
1924            }
1925            if self.get_recent_map_message_update() {
1926                items.push("recentMAPmessageUpdate: 1".into());
1927            }
1928            if self.get_recent_change_in_map_assigned_lanes_ids_used() {
1929                items.push("recentChangeInMAPassignedLanesIDsUsed: 1".into());
1930            }
1931            if self.get_no_valid_map_is_available_at_this_time() {
1932                items.push("noValidMAPisAvailableAtThisTime: 1".into());
1933            }
1934            if self.get_no_valid_spat_is_available_at_this_time() {
1935                items.push("noValidSPATisAvailableAtThisTime: 1".into());
1936            }
1937
1938            write!(f, "{}", items.join(", "))
1939        }
1940    }
1941
1942    impl Default for LaneAttributesBarrier {
1943        fn default() -> Self {
1944            Self(Default::default())
1945        }
1946    }
1947    impl LaneAttributesBarrier {
1948        pub fn get_median_revocable_lane(&self) -> bool {
1949            self.0[0]
1950        }
1951        pub fn get_median(&self) -> bool {
1952            self.0[1]
1953        }
1954        pub fn get_white_line_hashing(&self) -> bool {
1955            self.0[2]
1956        }
1957        pub fn get_striped_lines(&self) -> bool {
1958            self.0[3]
1959        }
1960        pub fn get_double_striped_lines(&self) -> bool {
1961            self.0[4]
1962        }
1963        pub fn get_traffic_cones(&self) -> bool {
1964            self.0[5]
1965        }
1966        pub fn get_construction_barrier(&self) -> bool {
1967            self.0[6]
1968        }
1969        pub fn get_traffic_channels(&self) -> bool {
1970            self.0[7]
1971        }
1972        pub fn get_low_curbs(&self) -> bool {
1973            self.0[8]
1974        }
1975        pub fn get_high_curbs(&self) -> bool {
1976            self.0[9]
1977        }
1978
1979        pub fn set_median_revocable_lane(&mut self, value: bool) {
1980            self.0.set(0, value)
1981        }
1982        pub fn set_median(&mut self, value: bool) {
1983            self.0.set(1, value)
1984        }
1985        pub fn set_white_line_hashing(&mut self, value: bool) {
1986            self.0.set(2, value)
1987        }
1988        pub fn set_striped_lines(&mut self, value: bool) {
1989            self.0.set(3, value)
1990        }
1991        pub fn set_double_striped_lines(&mut self, value: bool) {
1992            self.0.set(4, value)
1993        }
1994        pub fn set_traffic_cones(&mut self, value: bool) {
1995            self.0.set(5, value)
1996        }
1997        pub fn set_construction_barrier(&mut self, value: bool) {
1998            self.0.set(6, value)
1999        }
2000        pub fn set_traffic_channels(&mut self, value: bool) {
2001            self.0.set(7, value)
2002        }
2003        pub fn set_low_curbs(&mut self, value: bool) {
2004            self.0.set(8, value)
2005        }
2006        pub fn set_high_curbs(&mut self, value: bool) {
2007            self.0.set(9, value)
2008        }
2009    }
2010    impl core::fmt::Display for LaneAttributesBarrier {
2011        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2012            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2013
2014            if self.get_median_revocable_lane() {
2015                items.push("median-RevocableLane: 1".into());
2016            }
2017            if self.get_median() {
2018                items.push("median: 1".into());
2019            }
2020            if self.get_white_line_hashing() {
2021                items.push("whiteLineHashing: 1".into());
2022            }
2023            if self.get_striped_lines() {
2024                items.push("stripedLines: 1".into());
2025            }
2026            if self.get_double_striped_lines() {
2027                items.push("doubleStripedLines: 1".into());
2028            }
2029            if self.get_traffic_cones() {
2030                items.push("trafficCones: 1".into());
2031            }
2032            if self.get_construction_barrier() {
2033                items.push("constructionBarrier: 1".into());
2034            }
2035            if self.get_traffic_channels() {
2036                items.push("trafficChannels: 1".into());
2037            }
2038            if self.get_low_curbs() {
2039                items.push("lowCurbs: 1".into());
2040            }
2041            if self.get_high_curbs() {
2042                items.push("highCurbs: 1".into());
2043            }
2044
2045            write!(f, "{}", items.join(", "))
2046        }
2047    }
2048
2049    impl Default for LaneAttributesBike {
2050        fn default() -> Self {
2051            Self(Default::default())
2052        }
2053    }
2054    impl LaneAttributesBike {
2055        pub fn get_bike_revocable_lane(&self) -> bool {
2056            self.0[0]
2057        }
2058        pub fn get_pedestrian_use_allowed(&self) -> bool {
2059            self.0[1]
2060        }
2061        pub fn get_is_bike_fly_over_lane(&self) -> bool {
2062            self.0[2]
2063        }
2064        pub fn get_fixed_cycle_time(&self) -> bool {
2065            self.0[3]
2066        }
2067        pub fn get_bi_directional_cycle_times(&self) -> bool {
2068            self.0[4]
2069        }
2070        pub fn get_isolated_by_barrier(&self) -> bool {
2071            self.0[5]
2072        }
2073        pub fn get_unsignalized_segments_present(&self) -> bool {
2074            self.0[6]
2075        }
2076
2077        pub fn set_bike_revocable_lane(&mut self, value: bool) {
2078            self.0.set(0, value)
2079        }
2080        pub fn set_pedestrian_use_allowed(&mut self, value: bool) {
2081            self.0.set(1, value)
2082        }
2083        pub fn set_is_bike_fly_over_lane(&mut self, value: bool) {
2084            self.0.set(2, value)
2085        }
2086        pub fn set_fixed_cycle_time(&mut self, value: bool) {
2087            self.0.set(3, value)
2088        }
2089        pub fn set_bi_directional_cycle_times(&mut self, value: bool) {
2090            self.0.set(4, value)
2091        }
2092        pub fn set_isolated_by_barrier(&mut self, value: bool) {
2093            self.0.set(5, value)
2094        }
2095        pub fn set_unsignalized_segments_present(&mut self, value: bool) {
2096            self.0.set(6, value)
2097        }
2098    }
2099    impl core::fmt::Display for LaneAttributesBike {
2100        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2101            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2102
2103            if self.get_bike_revocable_lane() {
2104                items.push("bikeRevocableLane: 1".into());
2105            }
2106            if self.get_pedestrian_use_allowed() {
2107                items.push("pedestrianUseAllowed: 1".into());
2108            }
2109            if self.get_is_bike_fly_over_lane() {
2110                items.push("isBikeFlyOverLane: 1".into());
2111            }
2112            if self.get_fixed_cycle_time() {
2113                items.push("fixedCycleTime: 1".into());
2114            }
2115            if self.get_bi_directional_cycle_times() {
2116                items.push("biDirectionalCycleTimes: 1".into());
2117            }
2118            if self.get_isolated_by_barrier() {
2119                items.push("isolatedByBarrier: 1".into());
2120            }
2121            if self.get_unsignalized_segments_present() {
2122                items.push("unsignalizedSegmentsPresent: 1".into());
2123            }
2124
2125            write!(f, "{}", items.join(", "))
2126        }
2127    }
2128
2129    impl Default for LaneAttributesCrosswalk {
2130        fn default() -> Self {
2131            Self(Default::default())
2132        }
2133    }
2134    impl LaneAttributesCrosswalk {
2135        pub fn get_crosswalk_revocable_lane(&self) -> bool {
2136            self.0[0]
2137        }
2138        pub fn get_bicycle_use_allowed(&self) -> bool {
2139            self.0[1]
2140        }
2141        pub fn get_is_x_walk_fly_over_lane(&self) -> bool {
2142            self.0[2]
2143        }
2144        pub fn get_fixed_cycle_time(&self) -> bool {
2145            self.0[3]
2146        }
2147        pub fn get_bi_directional_cycle_times(&self) -> bool {
2148            self.0[4]
2149        }
2150        pub fn get_has_push_to_walk_button(&self) -> bool {
2151            self.0[5]
2152        }
2153        pub fn get_audio_support(&self) -> bool {
2154            self.0[6]
2155        }
2156        pub fn get_rf_signal_request_present(&self) -> bool {
2157            self.0[7]
2158        }
2159        pub fn get_unsignalized_segments_present(&self) -> bool {
2160            self.0[8]
2161        }
2162
2163        pub fn set_crosswalk_revocable_lane(&mut self, value: bool) {
2164            self.0.set(0, value)
2165        }
2166        pub fn set_bicycle_use_allowed(&mut self, value: bool) {
2167            self.0.set(1, value)
2168        }
2169        pub fn set_is_x_walk_fly_over_lane(&mut self, value: bool) {
2170            self.0.set(2, value)
2171        }
2172        pub fn set_fixed_cycle_time(&mut self, value: bool) {
2173            self.0.set(3, value)
2174        }
2175        pub fn set_bi_directional_cycle_times(&mut self, value: bool) {
2176            self.0.set(4, value)
2177        }
2178        pub fn set_has_push_to_walk_button(&mut self, value: bool) {
2179            self.0.set(5, value)
2180        }
2181        pub fn set_audio_support(&mut self, value: bool) {
2182            self.0.set(6, value)
2183        }
2184        pub fn set_rf_signal_request_present(&mut self, value: bool) {
2185            self.0.set(7, value)
2186        }
2187        pub fn set_unsignalized_segments_present(&mut self, value: bool) {
2188            self.0.set(8, value)
2189        }
2190    }
2191    impl core::fmt::Display for LaneAttributesCrosswalk {
2192        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2193            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2194
2195            if self.get_crosswalk_revocable_lane() {
2196                items.push("crosswalkRevocableLane: 1".into());
2197            }
2198            if self.get_bicycle_use_allowed() {
2199                items.push("bicyleUseAllowed: 1".into());
2200            }
2201            if self.get_is_x_walk_fly_over_lane() {
2202                items.push("isXwalkFlyOverLane: 1".into());
2203            }
2204            if self.get_fixed_cycle_time() {
2205                items.push("fixedCycleTime: 1".into());
2206            }
2207            if self.get_bi_directional_cycle_times() {
2208                items.push("biDirectionalCycleTimes: 1".into());
2209            }
2210            if self.get_has_push_to_walk_button() {
2211                items.push("hasPushToWalkButton: 1".into());
2212            }
2213            if self.get_audio_support() {
2214                items.push("audioSupport: 1".into());
2215            }
2216            if self.get_rf_signal_request_present() {
2217                items.push("rfSignalRequestPresent: 1".into());
2218            }
2219            if self.get_unsignalized_segments_present() {
2220                items.push("unsignalizedSegmentsPresent: 1".into());
2221            }
2222
2223            write!(f, "{}", items.join(", "))
2224        }
2225    }
2226
2227    impl Default for LaneAttributesParking {
2228        fn default() -> Self {
2229            Self(Default::default())
2230        }
2231    }
2232    impl LaneAttributesParking {
2233        pub fn get_parking_revocable_lane(&self) -> bool {
2234            self.0[0]
2235        }
2236        pub fn get_parallel_parking_in_use(&self) -> bool {
2237            self.0[1]
2238        }
2239        pub fn get_head_in_parking_in_use(&self) -> bool {
2240            self.0[2]
2241        }
2242        pub fn get_do_not_park_zone(&self) -> bool {
2243            self.0[3]
2244        }
2245        pub fn get_parking_for_bus_use(&self) -> bool {
2246            self.0[4]
2247        }
2248        pub fn get_parking_for_taxi_use(&self) -> bool {
2249            self.0[5]
2250        }
2251        pub fn get_no_public_parking_use(&self) -> bool {
2252            self.0[6]
2253        }
2254
2255        pub fn set_parking_revocable_lane(&mut self, value: bool) {
2256            self.0.set(0, value)
2257        }
2258        pub fn set_parallel_parking_in_use(&mut self, value: bool) {
2259            self.0.set(1, value)
2260        }
2261        pub fn set_head_in_parking_in_use(&mut self, value: bool) {
2262            self.0.set(2, value)
2263        }
2264        pub fn set_do_not_park_zone(&mut self, value: bool) {
2265            self.0.set(3, value)
2266        }
2267        pub fn set_parking_for_bus_use(&mut self, value: bool) {
2268            self.0.set(4, value)
2269        }
2270        pub fn set_parking_for_taxi_use(&mut self, value: bool) {
2271            self.0.set(5, value)
2272        }
2273        pub fn set_no_public_parking_use(&mut self, value: bool) {
2274            self.0.set(6, value)
2275        }
2276    }
2277    impl core::fmt::Display for LaneAttributesParking {
2278        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2279            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2280
2281            if self.get_parking_revocable_lane() {
2282                items.push("parkingRevocableLane: 1".into());
2283            }
2284            if self.get_parallel_parking_in_use() {
2285                items.push("parallelParkingInUse: 1".into());
2286            }
2287            if self.get_head_in_parking_in_use() {
2288                items.push("headInParkingInUse: 1".into());
2289            }
2290            if self.get_do_not_park_zone() {
2291                items.push("doNotParkZone: 1".into());
2292            }
2293            if self.get_parking_for_bus_use() {
2294                items.push("parkingForBusUse: 1".into());
2295            }
2296            if self.get_parking_for_taxi_use() {
2297                items.push("parkingForTaxiUse: 1".into());
2298            }
2299            if self.get_no_public_parking_use() {
2300                items.push("noPublicParkingUse: 1".into());
2301            }
2302
2303            write!(f, "{}", items.join(", "))
2304        }
2305    }
2306
2307    impl Default for LaneAttributesSidewalk {
2308        fn default() -> Self {
2309            Self(Default::default())
2310        }
2311    }
2312    impl LaneAttributesSidewalk {
2313        pub fn get_sidewalk_revocable_lane(&self) -> bool {
2314            self.0[0]
2315        }
2316        pub fn get_bicycle_use_allowed(&self) -> bool {
2317            self.0[1]
2318        }
2319        pub fn get_is_sidewalk_fly_over_lane(&self) -> bool {
2320            self.0[2]
2321        }
2322        pub fn get_walk_bikes(&self) -> bool {
2323            self.0[3]
2324        }
2325
2326        pub fn set_sidewalk_revocable_lane(&mut self, value: bool) {
2327            self.0.set(0, value)
2328        }
2329        pub fn set_bicycle_use_allowed(&mut self, value: bool) {
2330            self.0.set(1, value)
2331        }
2332        pub fn set_is_sidewalk_fly_over_lane(&mut self, value: bool) {
2333            self.0.set(2, value)
2334        }
2335        pub fn set_walk_bikes(&mut self, value: bool) {
2336            self.0.set(3, value)
2337        }
2338    }
2339    impl core::fmt::Display for LaneAttributesSidewalk {
2340        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2341            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2342
2343            if self.get_sidewalk_revocable_lane() {
2344                items.push("sidewalk-RevocableLane: 1".into());
2345            }
2346            if self.get_bicycle_use_allowed() {
2347                items.push("bicyleUseAllowed: 1".into());
2348            }
2349            if self.get_is_sidewalk_fly_over_lane() {
2350                items.push("isSidewalkFlyOverLane: 1".into());
2351            }
2352            if self.get_walk_bikes() {
2353                items.push("walkBikes: 1".into());
2354            }
2355
2356            write!(f, "{}", items.join(", "))
2357        }
2358    }
2359
2360    impl Default for LaneAttributesStriping {
2361        fn default() -> Self {
2362            Self(Default::default())
2363        }
2364    }
2365    impl LaneAttributesStriping {
2366        pub fn get_stripe_to_connecting_lanes_revocable_lane(&self) -> bool {
2367            self.0[0]
2368        }
2369        pub fn get_stripe_draw_on_left(&self) -> bool {
2370            self.0[1]
2371        }
2372        pub fn get_stripe_draw_on_right(&self) -> bool {
2373            self.0[2]
2374        }
2375        pub fn get_stripe_to_connecting_lanes_left(&self) -> bool {
2376            self.0[3]
2377        }
2378        pub fn get_stripe_to_connecting_lanes_right(&self) -> bool {
2379            self.0[4]
2380        }
2381        pub fn get_stripe_to_connecting_lanes_ahead(&self) -> bool {
2382            self.0[5]
2383        }
2384
2385        pub fn set_stripe_to_connecting_lanes_revocable_lane(&mut self, value: bool) {
2386            self.0.set(0, value)
2387        }
2388        pub fn set_stripe_draw_on_left(&mut self, value: bool) {
2389            self.0.set(1, value)
2390        }
2391        pub fn set_stripe_draw_on_right(&mut self, value: bool) {
2392            self.0.set(2, value)
2393        }
2394        pub fn set_stripe_to_connecting_lanes_left(&mut self, value: bool) {
2395            self.0.set(3, value)
2396        }
2397        pub fn set_stripe_to_connecting_lanes_right(&mut self, value: bool) {
2398            self.0.set(4, value)
2399        }
2400        pub fn set_stripe_to_connecting_lanes_ahead(&mut self, value: bool) {
2401            self.0.set(5, value)
2402        }
2403    }
2404    impl core::fmt::Display for LaneAttributesStriping {
2405        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2406            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2407
2408            if self.get_stripe_to_connecting_lanes_revocable_lane() {
2409                items.push("stripeToConnectingLanesRevocableLane: 1".into());
2410            }
2411            if self.get_stripe_draw_on_left() {
2412                items.push("stripeDrawOnLeft: 1".into());
2413            }
2414            if self.get_stripe_draw_on_right() {
2415                items.push("stripeDrawOnRight: 1".into());
2416            }
2417            if self.get_stripe_to_connecting_lanes_left() {
2418                items.push("stripeToConnectingLanesLeft: 1".into());
2419            }
2420            if self.get_stripe_to_connecting_lanes_right() {
2421                items.push("stripeToConnectingLanesRight: 1".into());
2422            }
2423            if self.get_stripe_to_connecting_lanes_ahead() {
2424                items.push("stripeToConnectingLanesAhead: 1".into());
2425            }
2426
2427            write!(f, "{}", items.join(", "))
2428        }
2429    }
2430
2431    impl Default for LaneAttributesTrackedVehicle {
2432        fn default() -> Self {
2433            Self(Default::default())
2434        }
2435    }
2436    impl LaneAttributesTrackedVehicle {
2437        pub fn get_spec_revocable_lane(&self) -> bool {
2438            self.0[0]
2439        }
2440        pub fn get_spec_commuter_rail_road_track(&self) -> bool {
2441            self.0[1]
2442        }
2443        pub fn get_spec_light_rail_road_track(&self) -> bool {
2444            self.0[2]
2445        }
2446        pub fn get_spec_heavy_rail_road_track(&self) -> bool {
2447            self.0[3]
2448        }
2449        pub fn get_spec_other_rail_type(&self) -> bool {
2450            self.0[4]
2451        }
2452
2453        pub fn set_spec_revocable_lane(&mut self, value: bool) {
2454            self.0.set(0, value)
2455        }
2456        pub fn set_spec_commuter_rail_road_track(&mut self, value: bool) {
2457            self.0.set(1, value)
2458        }
2459        pub fn set_spec_light_rail_road_track(&mut self, value: bool) {
2460            self.0.set(2, value)
2461        }
2462        pub fn set_spec_heavy_rail_road_track(&mut self, value: bool) {
2463            self.0.set(3, value)
2464        }
2465        pub fn set_spec_other_rail_type(&mut self, value: bool) {
2466            self.0.set(4, value)
2467        }
2468    }
2469    impl core::fmt::Display for LaneAttributesTrackedVehicle {
2470        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2471            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2472
2473            if self.get_spec_revocable_lane() {
2474                items.push("spec-RevocableLane: 1".into());
2475            }
2476            if self.get_spec_commuter_rail_road_track() {
2477                items.push("spec-commuterRailRoadTrack: 1".into());
2478            }
2479            if self.get_spec_light_rail_road_track() {
2480                items.push("spec-lightRailRoadTrack: 1".into());
2481            }
2482            if self.get_spec_heavy_rail_road_track() {
2483                items.push("spec-heavyRailRoadTrack: 1".into());
2484            }
2485            if self.get_spec_other_rail_type() {
2486                items.push("spec-otherRailType: 1".into());
2487            }
2488
2489            write!(f, "{}", items.join(", "))
2490        }
2491    }
2492
2493    impl Default for LaneAttributesVehicle {
2494        fn default() -> Self {
2495            Self(Default::default())
2496        }
2497    }
2498    impl LaneAttributesVehicle {
2499        pub fn get_is_vehicle_revocable_lane(&self) -> bool {
2500            self.0[0]
2501        }
2502        pub fn get_is_vehicle_fly_over_lane(&self) -> bool {
2503            self.0[1]
2504        }
2505        pub fn get_hov_lane_use_only(&self) -> bool {
2506            self.0[2]
2507        }
2508        pub fn get_restricted_to_bus_use(&self) -> bool {
2509            self.0[3]
2510        }
2511        pub fn get_restricted_to_taxi_use(&self) -> bool {
2512            self.0[4]
2513        }
2514        pub fn get_restricted_from_public_use(&self) -> bool {
2515            self.0[5]
2516        }
2517        pub fn get_has_irbeacon_coverage(&self) -> bool {
2518            self.0[6]
2519        }
2520        pub fn get_permission_on_request(&self) -> bool {
2521            self.0[7]
2522        }
2523
2524        pub fn set_is_vehicle_revocable_lane(&mut self, value: bool) {
2525            self.0.set(0, value)
2526        }
2527        pub fn set_is_vehicle_fly_over_lane(&mut self, value: bool) {
2528            self.0.set(1, value)
2529        }
2530        pub fn set_hov_lane_use_only(&mut self, value: bool) {
2531            self.0.set(2, value)
2532        }
2533        pub fn set_restricted_to_bus_use(&mut self, value: bool) {
2534            self.0.set(3, value)
2535        }
2536        pub fn set_restricted_to_taxi_use(&mut self, value: bool) {
2537            self.0.set(4, value)
2538        }
2539        pub fn set_restricted_from_public_use(&mut self, value: bool) {
2540            self.0.set(5, value)
2541        }
2542        pub fn set_has_irbeacon_coverage(&mut self, value: bool) {
2543            self.0.set(6, value)
2544        }
2545        pub fn set_permission_on_request(&mut self, value: bool) {
2546            self.0.set(7, value)
2547        }
2548    }
2549    impl core::fmt::Display for LaneAttributesVehicle {
2550        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2551            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2552
2553            if self.get_is_vehicle_revocable_lane() {
2554                items.push("isVehicleRevocableLane: 1".into());
2555            }
2556            if self.get_is_vehicle_fly_over_lane() {
2557                items.push("isVehicleFlyOverLane: 1".into());
2558            }
2559            if self.get_hov_lane_use_only() {
2560                items.push("hovLaneUseOnly: 1".into());
2561            }
2562            if self.get_restricted_to_bus_use() {
2563                items.push("restrictedToBusUse: 1".into());
2564            }
2565            if self.get_restricted_to_taxi_use() {
2566                items.push("restrictedToTaxiUse: 1".into());
2567            }
2568            if self.get_restricted_from_public_use() {
2569                items.push("restrictedFromPublicUse: 1".into());
2570            }
2571            if self.get_has_irbeacon_coverage() {
2572                items.push("hasIRbeaconCoverage: 1".into());
2573            }
2574            if self.get_permission_on_request() {
2575                items.push("permissionOnRequest: 1".into());
2576            }
2577
2578            write!(f, "{}", items.join(", "))
2579        }
2580    }
2581
2582    impl Default for LaneDirection {
2583        fn default() -> Self {
2584            Self(Default::default())
2585        }
2586    }
2587    impl LaneDirection {
2588        pub fn get_ingress_path(&self) -> bool {
2589            self.0[0]
2590        }
2591        pub fn get_egress_path(&self) -> bool {
2592            self.0[1]
2593        }
2594
2595        pub fn set_ingress_path(&mut self, value: bool) {
2596            self.0.set(0, value)
2597        }
2598        pub fn set_egress_path(&mut self, value: bool) {
2599            self.0.set(1, value)
2600        }
2601    }
2602    impl core::fmt::Display for LaneDirection {
2603        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2604            write!(
2605                f,
2606                "ingressPath: {}, egressPath: {}",
2607                self.get_ingress_path(),
2608                self.get_egress_path()
2609            )
2610        }
2611    }
2612
2613    impl Default for TransitVehicleStatus {
2614        fn default() -> Self {
2615            Self(Default::default())
2616        }
2617    }
2618    impl TransitVehicleStatus {
2619        pub fn get_loading(&self) -> bool {
2620            self.0[0]
2621        }
2622        pub fn get_an_ada_use(&self) -> bool {
2623            self.0[1]
2624        }
2625        pub fn get_a_bike_load(&self) -> bool {
2626            self.0[2]
2627        }
2628        pub fn get_door_open(&self) -> bool {
2629            self.0[3]
2630        }
2631        pub fn get_charging(&self) -> bool {
2632            self.0[4]
2633        }
2634
2635        pub fn set_loading(&mut self, value: bool) {
2636            self.0.set(0, value)
2637        }
2638        pub fn set_an_ada_use(&mut self, value: bool) {
2639            self.0.set(1, value)
2640        }
2641        pub fn set_a_bike_load(&mut self, value: bool) {
2642            self.0.set(2, value)
2643        }
2644        pub fn set_door_open(&mut self, value: bool) {
2645            self.0.set(3, value)
2646        }
2647        pub fn set_charging(&mut self, value: bool) {
2648            self.0.set(4, value)
2649        }
2650    }
2651    impl core::fmt::Display for TransitVehicleStatus {
2652        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2653            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2654
2655            if self.get_loading() {
2656                items.push("loading: 1".into());
2657            }
2658            if self.get_an_ada_use() {
2659                items.push("anADAuse: 1".into());
2660            }
2661            if self.get_a_bike_load() {
2662                items.push("aBikeLoad: 1".into());
2663            }
2664            if self.get_door_open() {
2665                items.push("doorOpen: 1".into());
2666            }
2667            if self.get_charging() {
2668                items.push("charging: 1".into());
2669            }
2670
2671            write!(f, "{}", items.join(", "))
2672        }
2673    }
2674
2675    impl TryFrom<alloc::string::String>
2676        for crate::standards::dsrc_2_2_1::etsi_its_dsrc::DescriptiveName
2677    {
2678        type Error = alloc::string::String;
2679
2680        fn try_from(value: alloc::string::String) -> Result<Self, Self::Error> {
2681            Ok(Self(
2682                Ia5String::from_iso646_bytes(value.as_bytes())
2683                    .map_err(|err| alloc::format!("Failed to create DescriptiveName: {err}"))?,
2684            ))
2685        }
2686    }
2687
2688    impl Default for OcitRequestorDescriptionContainer {
2689        fn default() -> Self {
2690            Self::new(None, None, None, None, None, None, None, None)
2691        }
2692    }
2693}
2694
2695#[cfg(feature = "ivim_2_2_1")]
2696/// Implementation of additional getters and setters for BITSTRING types with named bits
2697///
2698/// See individual types for available methods:
2699///
2700/// - [`DayOfWeek`](`crate::standards::ivim_2_2_1::gdd::DayOfWeek`)
2701/// - [`RepeatingPeriodDayTypes`](`crate::standards::ivim_2_2_1::gdd::RepeatingPeriodDayTypes`)
2702pub mod ivim_2_2_1 {
2703    use crate::standards::ivim_2_2_1::gdd::DayOfWeek;
2704
2705    impl Default for DayOfWeek {
2706        fn default() -> Self {
2707            Self(Default::default())
2708        }
2709    }
2710    impl DayOfWeek {
2711        pub fn get_unused(&self) -> bool {
2712            self.0[0]
2713        }
2714        pub fn get_monday(&self) -> bool {
2715            self.0[1]
2716        }
2717        pub fn get_tuesday(&self) -> bool {
2718            self.0[2]
2719        }
2720        pub fn get_wednesday(&self) -> bool {
2721            self.0[3]
2722        }
2723        pub fn get_thursday(&self) -> bool {
2724            self.0[4]
2725        }
2726        pub fn get_friday(&self) -> bool {
2727            self.0[5]
2728        }
2729        pub fn get_saturday(&self) -> bool {
2730            self.0[6]
2731        }
2732        pub fn get_sunday(&self) -> bool {
2733            self.0[7]
2734        }
2735
2736        pub fn set_unused(&mut self, value: bool) {
2737            self.0.set(0, value)
2738        }
2739        pub fn set_monday(&mut self, value: bool) {
2740            self.0.set(1, value)
2741        }
2742        pub fn set_tuesday(&mut self, value: bool) {
2743            self.0.set(2, value)
2744        }
2745        pub fn set_wednesday(&mut self, value: bool) {
2746            self.0.set(3, value)
2747        }
2748        pub fn set_thursday(&mut self, value: bool) {
2749            self.0.set(4, value)
2750        }
2751        pub fn set_friday(&mut self, value: bool) {
2752            self.0.set(5, value)
2753        }
2754        pub fn set_saturday(&mut self, value: bool) {
2755            self.0.set(6, value)
2756        }
2757        pub fn set_sunday(&mut self, value: bool) {
2758            self.0.set(7, value)
2759        }
2760    }
2761    impl core::fmt::Display for DayOfWeek {
2762        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2763            let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2764
2765            if self.get_unused() {
2766                items.push("unused: 1".into());
2767            }
2768            if self.get_monday() {
2769                items.push("monday: 1".into());
2770            }
2771            if self.get_tuesday() {
2772                items.push("tuesday: 1".into());
2773            }
2774            if self.get_wednesday() {
2775                items.push("wednesday: 1".into());
2776            }
2777            if self.get_thursday() {
2778                items.push("thursday: 1".into());
2779            }
2780            if self.get_friday() {
2781                items.push("friday: 1".into());
2782            }
2783            if self.get_saturday() {
2784                items.push("saturday: 1".into());
2785            }
2786            if self.get_sunday() {
2787                items.push("sunday: 1".into());
2788            }
2789
2790            write!(f, "{}", items.join(", "))
2791        }
2792    }
2793
2794    mod gdd {
2795        use crate::standards::ivim_2_2_1::gdd::RepeatingPeriodDayTypes;
2796
2797        impl Default for RepeatingPeriodDayTypes {
2798            fn default() -> Self {
2799                Self(Default::default())
2800            }
2801        }
2802        impl RepeatingPeriodDayTypes {
2803            pub fn get_national_holiday(&self) -> bool {
2804                self.0[0]
2805            }
2806            pub fn get_even_days(&self) -> bool {
2807                self.0[1]
2808            }
2809            pub fn get_odd_days(&self) -> bool {
2810                self.0[2]
2811            }
2812            pub fn get_market_day(&self) -> bool {
2813                self.0[3]
2814            }
2815
2816            pub fn set_national_holiday(&mut self, value: bool) {
2817                self.0.set(0, value)
2818            }
2819            pub fn set_even_days(&mut self, value: bool) {
2820                self.0.set(1, value)
2821            }
2822            pub fn set_odd_days(&mut self, value: bool) {
2823                self.0.set(2, value)
2824            }
2825            pub fn set_market_day(&mut self, value: bool) {
2826                self.0.set(3, value)
2827            }
2828        }
2829        impl core::fmt::Display for RepeatingPeriodDayTypes {
2830            fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2831                let mut items = alloc::vec::Vec::<alloc::string::String>::new();
2832
2833                if self.get_national_holiday() {
2834                    items.push("national-holiday: 1".into());
2835                }
2836                if self.get_even_days() {
2837                    items.push("even-days: 1".into());
2838                }
2839                if self.get_odd_days() {
2840                    items.push("odd-days: 1".into());
2841                }
2842                if self.get_market_day() {
2843                    items.push("market-day: 1".into());
2844                }
2845
2846                write!(f, "{}", items.join(", "))
2847            }
2848        }
2849    }
2850}