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