#[allow(unused_imports)]
use super::{common as com, common_extension as comx, location_referencing as loc, location_extension as locx, situation as sit, road_traffic_data as roa, vms, parking as prk, energy_infrastructure as egi, afir_energy_infrastructure as aegi, facilities as fac, afir_facilities as afac, controlled_zone as cz, traffic_management_plan as tmp, rerouting_management_enhanced as rer, urban_extensions as ubx, fault_and_status as fst};
#[allow(unused_imports)]
use crate::out::{Out, Pattern};
#[allow(unused_imports)]
use crate::xml::{Enumeration, Xml};
#[allow(unused_imports)]
use crate::{Date, DateTime, Decimal, Error, Extension, MultilingualString, Time};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ADRTunnelCategoryTypeEnum {
CategoryA,
CategoryB,
CategoryC,
CategoryD,
CategoryE,
Extended(String),
}
impl ADRTunnelCategoryTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::CategoryA => "categoryA",
Self::CategoryB => "categoryB",
Self::CategoryC => "categoryC",
Self::CategoryD => "categoryD",
Self::CategoryE => "categoryE",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ADRTunnelCategoryTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"categoryA" => Some(Self::CategoryA),
"categoryB" => Some(Self::CategoryB),
"categoryC" => Some(Self::CategoryC),
"categoryD" => Some(Self::CategoryD),
"categoryE" => Some(Self::CategoryE),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ADRTunnelCategoryTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccessConditionTypeEnum {
AccessOnly,
DestinationTraffic,
LoadingAndUnloading,
NecessaryHospitalAndDoctorConsultations,
PassengerLoadingAndUnloading,
SocialAndCareSupportServices,
SourceAndDestinationTraffic,
SourceTraffic,
ThroughTraffic,
SnowChainsCompulsory,
Extended(String),
}
impl AccessConditionTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AccessOnly => "accessOnly",
Self::DestinationTraffic => "destinationTraffic",
Self::LoadingAndUnloading => "loadingAndUnloading",
Self::NecessaryHospitalAndDoctorConsultations => "necessaryHospitalAndDoctorConsultations",
Self::PassengerLoadingAndUnloading => "passengerLoadingAndUnloading",
Self::SocialAndCareSupportServices => "socialAndCareSupportServices",
Self::SourceAndDestinationTraffic => "sourceAndDestinationTraffic",
Self::SourceTraffic => "sourceTraffic",
Self::ThroughTraffic => "throughTraffic",
Self::SnowChainsCompulsory => "snowChainsCompulsory",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AccessConditionTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"accessOnly" => Some(Self::AccessOnly),
"destinationTraffic" => Some(Self::DestinationTraffic),
"loadingAndUnloading" => Some(Self::LoadingAndUnloading),
"necessaryHospitalAndDoctorConsultations" => Some(Self::NecessaryHospitalAndDoctorConsultations),
"passengerLoadingAndUnloading" => Some(Self::PassengerLoadingAndUnloading),
"socialAndCareSupportServices" => Some(Self::SocialAndCareSupportServices),
"sourceAndDestinationTraffic" => Some(Self::SourceAndDestinationTraffic),
"sourceTraffic" => Some(Self::SourceTraffic),
"throughTraffic" => Some(Self::ThroughTraffic),
"snowChainsCompulsory" => Some(Self::SnowChainsCompulsory),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AccessConditionTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccessRestrictionTypeEnum {
NoEntry,
NoPassingWithoutStopping,
UseOfAudibleWarningDevicesProhibited,
LaneUsageProhibited,
RestrictedAccess,
Extended(String),
}
impl AccessRestrictionTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::NoEntry => "noEntry",
Self::NoPassingWithoutStopping => "noPassingWithoutStopping",
Self::UseOfAudibleWarningDevicesProhibited => "useOfAudibleWarningDevicesProhibited",
Self::LaneUsageProhibited => "laneUsageProhibited",
Self::RestrictedAccess => "restrictedAccess",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AccessRestrictionTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"noEntry" => Some(Self::NoEntry),
"noPassingWithoutStopping" => Some(Self::NoPassingWithoutStopping),
"useOfAudibleWarningDevicesProhibited" => Some(Self::UseOfAudibleWarningDevicesProhibited),
"laneUsageProhibited" => Some(Self::LaneUsageProhibited),
"restrictedAccess" => Some(Self::RestrictedAccess),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AccessRestrictionTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ActivationStatusEnum {
Active,
BeingSetUp,
BeingShutDown,
Inactive,
Scheduled,
Extended(String),
}
impl ActivationStatusEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Active => "active",
Self::BeingSetUp => "beingSetUp",
Self::BeingShutDown => "beingShutDown",
Self::Inactive => "inactive",
Self::Scheduled => "scheduled",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ActivationStatusEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"active" => Some(Self::Active),
"beingSetUp" => Some(Self::BeingSetUp),
"beingShutDown" => Some(Self::BeingShutDown),
"inactive" => Some(Self::Inactive),
"scheduled" => Some(Self::Scheduled),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ActivationStatusEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AmbientWarningTypeEnum {
AccompaniedHorsesCrossing,
Airfield,
Cattle,
FallingRocks,
InsufficientStructureGauge,
LooseGravel,
MigratoryToadCrossing,
OtherDanger,
PedestrianCrossing,
PoorVisibility,
QuaysideOrRiverBank,
RiskOfIce,
SideWindsLeft,
SideWindsRight,
WildAnimalsCrossing,
Extended(String),
}
impl AmbientWarningTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AccompaniedHorsesCrossing => "accompaniedHorsesCrossing",
Self::Airfield => "airfield",
Self::Cattle => "cattle",
Self::FallingRocks => "fallingRocks",
Self::InsufficientStructureGauge => "insufficientStructureGauge",
Self::LooseGravel => "looseGravel",
Self::MigratoryToadCrossing => "migratoryToadCrossing",
Self::OtherDanger => "otherDanger",
Self::PedestrianCrossing => "pedestrianCrossing",
Self::PoorVisibility => "poorVisibility",
Self::QuaysideOrRiverBank => "quaysideOrRiverBank",
Self::RiskOfIce => "riskOfIce",
Self::SideWindsLeft => "sideWindsLeft",
Self::SideWindsRight => "sideWindsRight",
Self::WildAnimalsCrossing => "wildAnimalsCrossing",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AmbientWarningTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"accompaniedHorsesCrossing" => Some(Self::AccompaniedHorsesCrossing),
"airfield" => Some(Self::Airfield),
"cattle" => Some(Self::Cattle),
"fallingRocks" => Some(Self::FallingRocks),
"insufficientStructureGauge" => Some(Self::InsufficientStructureGauge),
"looseGravel" => Some(Self::LooseGravel),
"migratoryToadCrossing" => Some(Self::MigratoryToadCrossing),
"otherDanger" => Some(Self::OtherDanger),
"pedestrianCrossing" => Some(Self::PedestrianCrossing),
"poorVisibility" => Some(Self::PoorVisibility),
"quaysideOrRiverBank" => Some(Self::QuaysideOrRiverBank),
"riskOfIce" => Some(Self::RiskOfIce),
"sideWindsLeft" => Some(Self::SideWindsLeft),
"sideWindsRight" => Some(Self::SideWindsRight),
"wildAnimalsCrossing" => Some(Self::WildAnimalsCrossing),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AmbientWarningTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type AmountOfMoney = Decimal;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ConditionOperator {
And,
Or,
Xor,
Extended(String),
}
impl ConditionOperator {
pub fn as_str(&self) -> &str {
match self {
Self::And => "and",
Self::Or => "or",
Self::Xor => "xor",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ConditionOperator {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"and" => Some(Self::And),
"or" => Some(Self::Or),
"xor" => Some(Self::Xor),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ConditionOperator {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DirectionRestrictionTypeEnum {
AheadOnly,
KeepLeft,
KeepRight,
NoLeftTurn,
NoReversing,
NoRightTurn,
NoThroughRoad,
NoUTurn,
OneWayTraffic,
PassEitherSide,
Roundabout,
StraightAheadOrTurnLeft,
StraightAheadOrTurnRight,
TurnLeft,
TurnLeftAhead,
TurnLeftOrTurnRight,
TurnRight,
TurnRightAhead,
Extended(String),
}
impl DirectionRestrictionTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AheadOnly => "aheadOnly",
Self::KeepLeft => "keepLeft",
Self::KeepRight => "keepRight",
Self::NoLeftTurn => "noLeftTurn",
Self::NoReversing => "noReversing",
Self::NoRightTurn => "noRightTurn",
Self::NoThroughRoad => "noThroughRoad",
Self::NoUTurn => "noUTurn",
Self::OneWayTraffic => "oneWayTraffic",
Self::PassEitherSide => "passEitherSide",
Self::Roundabout => "roundabout",
Self::StraightAheadOrTurnLeft => "straightAheadOrTurnLeft",
Self::StraightAheadOrTurnRight => "straightAheadOrTurnRight",
Self::TurnLeft => "turnLeft",
Self::TurnLeftAhead => "turnLeftAhead",
Self::TurnLeftOrTurnRight => "turnLeftOrTurnRight",
Self::TurnRight => "turnRight",
Self::TurnRightAhead => "turnRightAhead",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DirectionRestrictionTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"aheadOnly" => Some(Self::AheadOnly),
"keepLeft" => Some(Self::KeepLeft),
"keepRight" => Some(Self::KeepRight),
"noLeftTurn" => Some(Self::NoLeftTurn),
"noReversing" => Some(Self::NoReversing),
"noRightTurn" => Some(Self::NoRightTurn),
"noThroughRoad" => Some(Self::NoThroughRoad),
"noUTurn" => Some(Self::NoUTurn),
"oneWayTraffic" => Some(Self::OneWayTraffic),
"passEitherSide" => Some(Self::PassEitherSide),
"roundabout" => Some(Self::Roundabout),
"straightAheadOrTurnLeft" => Some(Self::StraightAheadOrTurnLeft),
"straightAheadOrTurnRight" => Some(Self::StraightAheadOrTurnRight),
"turnLeft" => Some(Self::TurnLeft),
"turnLeftAhead" => Some(Self::TurnLeftAhead),
"turnLeftOrTurnRight" => Some(Self::TurnLeftOrTurnRight),
"turnRight" => Some(Self::TurnRight),
"turnRightAhead" => Some(Self::TurnRightAhead),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DirectionRestrictionTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DriverCharacteristicsTypeEnum {
DisabledWithPermit,
HotelGuest,
LearnerDriver,
LocalResident,
Extended(String),
}
impl DriverCharacteristicsTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::DisabledWithPermit => "disabledWithPermit",
Self::HotelGuest => "hotelGuest",
Self::LearnerDriver => "learnerDriver",
Self::LocalResident => "localResident",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DriverCharacteristicsTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"disabledWithPermit" => Some(Self::DisabledWithPermit),
"hotelGuest" => Some(Self::HotelGuest),
"learnerDriver" => Some(Self::LearnerDriver),
"localResident" => Some(Self::LocalResident),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DriverCharacteristicsTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type Duration = String;
pub type GddPictogramCategoryCode = u64;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GddServiceCategoryEnum {
AmbientConditions,
DangerWarning,
Informative,
PublicFacilities,
Regulatory,
RoadConditions,
Extended(String),
}
impl GddServiceCategoryEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AmbientConditions => "ambientConditions",
Self::DangerWarning => "dangerWarning",
Self::Informative => "informative",
Self::PublicFacilities => "publicFacilities",
Self::Regulatory => "regulatory",
Self::RoadConditions => "roadConditions",
Self::Extended(v) => v,
}
}
}
impl Enumeration for GddServiceCategoryEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"ambientConditions" => Some(Self::AmbientConditions),
"dangerWarning" => Some(Self::DangerWarning),
"informative" => Some(Self::Informative),
"publicFacilities" => Some(Self::PublicFacilities),
"regulatory" => Some(Self::Regulatory),
"roadConditions" => Some(Self::RoadConditions),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl GddServiceCategoryEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum LicenceCharacteristicsEnum {
Permanent,
Provisional,
Extended(String),
}
impl LicenceCharacteristicsEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Permanent => "permanent",
Self::Provisional => "provisional",
Self::Extended(v) => v,
}
}
}
impl Enumeration for LicenceCharacteristicsEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"permanent" => Some(Self::Permanent),
"provisional" => Some(Self::Provisional),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl LicenceCharacteristicsEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum NonVehicularRoadUserTypeEnum {
CattleDrive,
Pedestrians,
RiddenOrAccompaniedHorses,
Cattle,
Equestrian,
Extended(String),
}
impl NonVehicularRoadUserTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::CattleDrive => "cattleDrive",
Self::Pedestrians => "pedestrians",
Self::RiddenOrAccompaniedHorses => "riddenOrAccompaniedHorses",
Self::Cattle => "cattle",
Self::Equestrian => "equestrian",
Self::Extended(v) => v,
}
}
}
impl Enumeration for NonVehicularRoadUserTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"cattleDrive" => Some(Self::CattleDrive),
"pedestrians" => Some(Self::Pedestrians),
"riddenOrAccompaniedHorses" => Some(Self::RiddenOrAccompaniedHorses),
"cattle" => Some(Self::Cattle),
"equestrian" => Some(Self::Equestrian),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl NonVehicularRoadUserTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PermitOwnerTypeEnum {
Vehicle,
VehicleOccupant,
VehicleOwner,
Extended(String),
}
impl PermitOwnerTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Vehicle => "vehicle",
Self::VehicleOccupant => "vehicleOccupant",
Self::VehicleOwner => "vehicleOwner",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PermitOwnerTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"vehicle" => Some(Self::Vehicle),
"vehicleOccupant" => Some(Self::VehicleOccupant),
"vehicleOwner" => Some(Self::VehicleOwner),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PermitOwnerTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PermitTypeEnum {
Electronic,
Other,
Paper,
Sticker,
Extended(String),
}
impl PermitTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Electronic => "electronic",
Self::Other => "other",
Self::Paper => "paper",
Self::Sticker => "sticker",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PermitTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"electronic" => Some(Self::Electronic),
"other" => Some(Self::Other),
"paper" => Some(Self::Paper),
"sticker" => Some(Self::Sticker),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PermitTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PriorityRuleTypeEnum {
GiveWay,
GiveWayToOncomingVehicles,
GiveWayToRail,
GiveWayToSchoolCrossingPatrol,
GiveWayToTram,
PriorityAtNextJunction,
PriorityOverOncomingVehicles,
PriorityRoad,
Stop,
Extended(String),
}
impl PriorityRuleTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::GiveWay => "giveWay",
Self::GiveWayToOncomingVehicles => "giveWayToOncomingVehicles",
Self::GiveWayToRail => "giveWayToRail",
Self::GiveWayToSchoolCrossingPatrol => "giveWayToSchoolCrossingPatrol",
Self::GiveWayToTram => "giveWayToTram",
Self::PriorityAtNextJunction => "priorityAtNextJunction",
Self::PriorityOverOncomingVehicles => "priorityOverOncomingVehicles",
Self::PriorityRoad => "priorityRoad",
Self::Stop => "stop",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PriorityRuleTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"giveWay" => Some(Self::GiveWay),
"giveWayToOncomingVehicles" => Some(Self::GiveWayToOncomingVehicles),
"giveWayToRail" => Some(Self::GiveWayToRail),
"giveWayToSchoolCrossingPatrol" => Some(Self::GiveWayToSchoolCrossingPatrol),
"giveWayToTram" => Some(Self::GiveWayToTram),
"priorityAtNextJunction" => Some(Self::PriorityAtNextJunction),
"priorityOverOncomingVehicles" => Some(Self::PriorityOverOncomingVehicles),
"priorityRoad" => Some(Self::PriorityRoad),
"stop" => Some(Self::Stop),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PriorityRuleTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReasonForRegulationEnum {
Other,
ProtectionOfNoiseAndEmissions,
ProtectionOfRoad,
ProtectionOfWaters,
PublicSafety,
ResearchAndTest,
Roadworks,
TrafficOrder,
TrafficSafety,
Extended(String),
}
impl ReasonForRegulationEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Other => "other",
Self::ProtectionOfNoiseAndEmissions => "protectionOfNoiseAndEmissions",
Self::ProtectionOfRoad => "protectionOfRoad",
Self::ProtectionOfWaters => "protectionOfWaters",
Self::PublicSafety => "publicSafety",
Self::ResearchAndTest => "researchAndTest",
Self::Roadworks => "roadworks",
Self::TrafficOrder => "trafficOrder",
Self::TrafficSafety => "trafficSafety",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ReasonForRegulationEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"other" => Some(Self::Other),
"protectionOfNoiseAndEmissions" => Some(Self::ProtectionOfNoiseAndEmissions),
"protectionOfRoad" => Some(Self::ProtectionOfRoad),
"protectionOfWaters" => Some(Self::ProtectionOfWaters),
"publicSafety" => Some(Self::PublicSafety),
"researchAndTest" => Some(Self::ResearchAndTest),
"roadworks" => Some(Self::Roadworks),
"trafficOrder" => Some(Self::TrafficOrder),
"trafficSafety" => Some(Self::TrafficSafety),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ReasonForRegulationEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RoadOrCarriagewayOrLaneLayoutType {
Carriageway,
Lane,
Road,
Extended(String),
}
impl RoadOrCarriagewayOrLaneLayoutType {
pub fn as_str(&self) -> &str {
match self {
Self::Carriageway => "carriageway",
Self::Lane => "lane",
Self::Road => "road",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RoadOrCarriagewayOrLaneLayoutType {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"carriageway" => Some(Self::Carriageway),
"lane" => Some(Self::Lane),
"road" => Some(Self::Road),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RoadOrCarriagewayOrLaneLayoutType {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RoadOrCarriagewayOrLaneStatus {
Closed,
DeviatedToHardShoulder,
DeviatedToLeft,
DeviatedToOtherCarriageway,
DeviatedToRight,
MergedToLeft,
MergedToRight,
Open,
Extended(String),
}
impl RoadOrCarriagewayOrLaneStatus {
pub fn as_str(&self) -> &str {
match self {
Self::Closed => "closed",
Self::DeviatedToHardShoulder => "deviatedToHardShoulder",
Self::DeviatedToLeft => "deviatedToLeft",
Self::DeviatedToOtherCarriageway => "deviatedToOtherCarriageway",
Self::DeviatedToRight => "deviatedToRight",
Self::MergedToLeft => "mergedToLeft",
Self::MergedToRight => "mergedToRight",
Self::Open => "open",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RoadOrCarriagewayOrLaneStatus {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"closed" => Some(Self::Closed),
"deviatedToHardShoulder" => Some(Self::DeviatedToHardShoulder),
"deviatedToLeft" => Some(Self::DeviatedToLeft),
"deviatedToOtherCarriageway" => Some(Self::DeviatedToOtherCarriageway),
"deviatedToRight" => Some(Self::DeviatedToRight),
"mergedToLeft" => Some(Self::MergedToLeft),
"mergedToRight" => Some(Self::MergedToRight),
"open" => Some(Self::Open),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RoadOrCarriagewayOrLaneStatus {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RoadTypeEnum {
ExpressRoad,
InsideBuiltUpAreas,
Motorway,
OutsideBuiltUpAreas,
Extended(String),
}
impl RoadTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::ExpressRoad => "expressRoad",
Self::InsideBuiltUpAreas => "insideBuiltUpAreas",
Self::Motorway => "motorway",
Self::OutsideBuiltUpAreas => "outsideBuiltUpAreas",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RoadTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"expressRoad" => Some(Self::ExpressRoad),
"insideBuiltUpAreas" => Some(Self::InsideBuiltUpAreas),
"motorway" => Some(Self::Motorway),
"outsideBuiltUpAreas" => Some(Self::OutsideBuiltUpAreas),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RoadTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RoadWarningTypeEnum {
Accident,
BendToLeft,
BendToRight,
CrossroadsWithPriorityFromRight,
DoubleBendFirstToLeft,
DoubleBendFirstToRight,
LateralStep,
ObstacleOnTheRoad,
RoadDip,
RoadHump,
RoadNarrowsBothSides,
RoadNarrowsLeft,
RoadNarrowsRight,
RoadWorks,
RoundaboutAntiClockwise,
RoundaboutClockwise,
SlipperyRoad,
SwingBridge,
LightSignals,
UnevenRoad,
Extended(String),
}
impl RoadWarningTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Accident => "accident",
Self::BendToLeft => "bendToLeft",
Self::BendToRight => "bendToRight",
Self::CrossroadsWithPriorityFromRight => "crossroadsWithPriorityFromRight",
Self::DoubleBendFirstToLeft => "doubleBendFirstToLeft",
Self::DoubleBendFirstToRight => "doubleBendFirstToRight",
Self::LateralStep => "lateralStep",
Self::ObstacleOnTheRoad => "obstacleOnTheRoad",
Self::RoadDip => "roadDip",
Self::RoadHump => "roadHump",
Self::RoadNarrowsBothSides => "roadNarrowsBothSides",
Self::RoadNarrowsLeft => "roadNarrowsLeft",
Self::RoadNarrowsRight => "roadNarrowsRight",
Self::RoadWorks => "roadWorks",
Self::RoundaboutAntiClockwise => "roundaboutAntiClockwise",
Self::RoundaboutClockwise => "roundaboutClockwise",
Self::SlipperyRoad => "slipperyRoad",
Self::SwingBridge => "swingBridge",
Self::LightSignals => "lightSignals",
Self::UnevenRoad => "unevenRoad",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RoadWarningTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"accident" => Some(Self::Accident),
"bendToLeft" => Some(Self::BendToLeft),
"bendToRight" => Some(Self::BendToRight),
"crossroadsWithPriorityFromRight" => Some(Self::CrossroadsWithPriorityFromRight),
"doubleBendFirstToLeft" => Some(Self::DoubleBendFirstToLeft),
"doubleBendFirstToRight" => Some(Self::DoubleBendFirstToRight),
"lateralStep" => Some(Self::LateralStep),
"obstacleOnTheRoad" => Some(Self::ObstacleOnTheRoad),
"roadDip" => Some(Self::RoadDip),
"roadHump" => Some(Self::RoadHump),
"roadNarrowsBothSides" => Some(Self::RoadNarrowsBothSides),
"roadNarrowsLeft" => Some(Self::RoadNarrowsLeft),
"roadNarrowsRight" => Some(Self::RoadNarrowsRight),
"roadWorks" => Some(Self::RoadWorks),
"roundaboutAntiClockwise" => Some(Self::RoundaboutAntiClockwise),
"roundaboutClockwise" => Some(Self::RoundaboutClockwise),
"slipperyRoad" => Some(Self::SlipperyRoad),
"swingBridge" => Some(Self::SwingBridge),
"lightSignals" => Some(Self::LightSignals),
"unevenRoad" => Some(Self::UnevenRoad),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RoadWarningTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum StandingOrParkingConditionTypeEnum {
ElectricVehicleDuringCharging,
FootwayAlso,
FootwayOnly,
GettingInAndOutOfAVehicle,
KerbsideAlso,
KerbsideOnly,
LoadingAndUnloading,
VergeAlso,
VergeOnly,
Extended(String),
}
impl StandingOrParkingConditionTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::ElectricVehicleDuringCharging => "electricVehicleDuringCharging",
Self::FootwayAlso => "footwayAlso",
Self::FootwayOnly => "footwayOnly",
Self::GettingInAndOutOfAVehicle => "gettingInAndOutOfAVehicle",
Self::KerbsideAlso => "kerbsideAlso",
Self::KerbsideOnly => "kerbsideOnly",
Self::LoadingAndUnloading => "loadingAndUnloading",
Self::VergeAlso => "vergeAlso",
Self::VergeOnly => "vergeOnly",
Self::Extended(v) => v,
}
}
}
impl Enumeration for StandingOrParkingConditionTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"electricVehicleDuringCharging" => Some(Self::ElectricVehicleDuringCharging),
"footwayAlso" => Some(Self::FootwayAlso),
"footwayOnly" => Some(Self::FootwayOnly),
"gettingInAndOutOfAVehicle" => Some(Self::GettingInAndOutOfAVehicle),
"kerbsideAlso" => Some(Self::KerbsideAlso),
"kerbsideOnly" => Some(Self::KerbsideOnly),
"loadingAndUnloading" => Some(Self::LoadingAndUnloading),
"vergeAlso" => Some(Self::VergeAlso),
"vergeOnly" => Some(Self::VergeOnly),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl StandingOrParkingConditionTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum StandingOrParkingControlTypeEnum {
ParkingProhibited,
StandingAndParkingProhibited,
ParkingPermitted,
ParkingOutsideDesignatedParkingSpacesProhibited,
Extended(String),
}
impl StandingOrParkingControlTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::ParkingProhibited => "parkingProhibited",
Self::StandingAndParkingProhibited => "standingAndParkingProhibited",
Self::ParkingPermitted => "parkingPermitted",
Self::ParkingOutsideDesignatedParkingSpacesProhibited => "parkingOutsideDesignatedParkingSpacesProhibited",
Self::Extended(v) => v,
}
}
}
impl Enumeration for StandingOrParkingControlTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"parkingProhibited" => Some(Self::ParkingProhibited),
"standingAndParkingProhibited" => Some(Self::StandingAndParkingProhibited),
"parkingPermitted" => Some(Self::ParkingPermitted),
"parkingOutsideDesignatedParkingSpacesProhibited" => Some(Self::ParkingOutsideDesignatedParkingSpacesProhibited),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl StandingOrParkingControlTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SteepHillDirectionTypeEnum {
Downwards,
Upwards,
Extended(String),
}
impl SteepHillDirectionTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Downwards => "downwards",
Self::Upwards => "upwards",
Self::Extended(v) => v,
}
}
}
impl Enumeration for SteepHillDirectionTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"downwards" => Some(Self::Downwards),
"upwards" => Some(Self::Upwards),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl SteepHillDirectionTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TrafficAheadTypeEnum {
BusCrossing,
Children,
CycleRoute,
LevelCrossing,
LevelCrossingWithGate,
PedestrianCrossing,
RidingPath,
TrafficQueues,
TramsCrossingAhead,
TwoWayTraffic,
Extended(String),
}
impl TrafficAheadTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::BusCrossing => "busCrossing",
Self::Children => "children",
Self::CycleRoute => "cycleRoute",
Self::LevelCrossing => "levelCrossing",
Self::LevelCrossingWithGate => "levelCrossingWithGate",
Self::PedestrianCrossing => "pedestrianCrossing",
Self::RidingPath => "ridingPath",
Self::TrafficQueues => "trafficQueues",
Self::TramsCrossingAhead => "tramsCrossingAhead",
Self::TwoWayTraffic => "twoWayTraffic",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TrafficAheadTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"busCrossing" => Some(Self::BusCrossing),
"children" => Some(Self::Children),
"cycleRoute" => Some(Self::CycleRoute),
"levelCrossing" => Some(Self::LevelCrossing),
"levelCrossingWithGate" => Some(Self::LevelCrossingWithGate),
"pedestrianCrossing" => Some(Self::PedestrianCrossing),
"ridingPath" => Some(Self::RidingPath),
"trafficQueues" => Some(Self::TrafficQueues),
"tramsCrossingAhead" => Some(Self::TramsCrossingAhead),
"twoWayTraffic" => Some(Self::TwoWayTraffic),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TrafficAheadTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TrafficRegulationInstallerTypeEnum {
FireBrigade,
Police,
PublicWorkOrUtilityCompanies,
RoadOperator,
Extended(String),
}
impl TrafficRegulationInstallerTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::FireBrigade => "fireBrigade",
Self::Police => "police",
Self::PublicWorkOrUtilityCompanies => "publicWorkOrUtilityCompanies",
Self::RoadOperator => "roadOperator",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TrafficRegulationInstallerTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"fireBrigade" => Some(Self::FireBrigade),
"police" => Some(Self::Police),
"publicWorkOrUtilityCompanies" => Some(Self::PublicWorkOrUtilityCompanies),
"roadOperator" => Some(Self::RoadOperator),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TrafficRegulationInstallerTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TrafficRegulationOrderStatusEnum {
MadeAndImplemented,
MadeAndPartiallyImplemented,
MadeButNotImplemented,
PartiallyWithdrawn,
Planned,
Withdrawn,
Extended(String),
}
impl TrafficRegulationOrderStatusEnum {
pub fn as_str(&self) -> &str {
match self {
Self::MadeAndImplemented => "madeAndImplemented",
Self::MadeAndPartiallyImplemented => "madeAndPartiallyImplemented",
Self::MadeButNotImplemented => "madeButNotImplemented",
Self::PartiallyWithdrawn => "partiallyWithdrawn",
Self::Planned => "planned",
Self::Withdrawn => "withdrawn",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TrafficRegulationOrderStatusEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"madeAndImplemented" => Some(Self::MadeAndImplemented),
"madeAndPartiallyImplemented" => Some(Self::MadeAndPartiallyImplemented),
"madeButNotImplemented" => Some(Self::MadeButNotImplemented),
"partiallyWithdrawn" => Some(Self::PartiallyWithdrawn),
"planned" => Some(Self::Planned),
"withdrawn" => Some(Self::Withdrawn),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TrafficRegulationOrderStatusEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UnitOfSpeedEnum {
KilometresPerHour,
MilesPerHour,
Extended(String),
}
impl UnitOfSpeedEnum {
pub fn as_str(&self) -> &str {
match self {
Self::KilometresPerHour => "kilometresPerHour",
Self::MilesPerHour => "milesPerHour",
Self::Extended(v) => v,
}
}
}
impl Enumeration for UnitOfSpeedEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"kilometresPerHour" => Some(Self::KilometresPerHour),
"milesPerHour" => Some(Self::MilesPerHour),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl UnitOfSpeedEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AccessCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub access_condition_type: Vec<AccessConditionTypeEnum>,
pub other_access_restriction: Option<MultilingualString>,
pub applicable_location: Option<loc::LocationReference>,
pub access_condition_extension: Option<Box<Extension>>,
}
impl AccessCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110665, 0x1109e4, 0x1106c8, 0x1103f1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110003);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110665 => { let v = r.enumeration::<AccessConditionTypeEnum>()?; e4.extend(v); }
0x1109e4 => { let v = r.multilingual()?; r.set(&mut e5, v, 2532); }
0x1106c8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e6, v, 1736); }
0x1103f1 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1009); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
access_condition_type: e4,
other_access_restriction: e5,
applicable_location: e6,
access_condition_extension: e7,
};
r.close();
Ok(v)
}
}
impl AccessCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
w.count("tro:accessConditionType", self.access_condition_type.len(), 1, usize::MAX)?;
for v in &self.access_condition_type { w.enumeration("tro:accessConditionType", v.literal())?; }
if let Some(v) = &self.other_access_restriction { w.multilingual("tro:otherAccessRestriction", v)?; }
if let Some(v) = &self.applicable_location { v.write(w, "tro:applicableLocation")?; }
if let Some(v) = &self.access_condition_extension { w.extension("tro:_accessConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AccessRestriction {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub access_restriction_type: Option<AccessRestrictionTypeEnum>,
pub access_restriction_extension: Option<Box<Extension>>,
}
impl AccessRestriction {
const FIELDS: &'static [u32] = &[0x110629, 0x110669, 0x1103f5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110006);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110669 => { let v = r.enumeration::<AccessRestrictionTypeEnum>()?; r.set(&mut e1, v, 1641); }
0x1103f5 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1013); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1641);
let v = Self {
type_of_regulation_extension: e0,
access_restriction_type: e1,
access_restriction_extension: e2,
};
r.close();
Ok(v)
}
}
impl AccessRestriction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
match &self.access_restriction_type {
Some(v) => { w.enumeration("tro:accessRestrictionType", v.literal())?; }
None => return Err(w.missing("tro:accessRestrictionType")),
}
if let Some(v) = &self.access_restriction_extension { w.extension("tro:_accessRestrictionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ActivatedRegulation {
pub actor: Option<MultilingualString>,
pub issuing_authority: Option<MultilingualString>,
pub regulation_id: Option<String>,
pub traffic_regulation: Vec<AnyTrafficRegulation>,
pub activated_regulation_extension: Option<Box<Extension>>,
}
impl ActivatedRegulation {
const FIELDS: &'static [u32] = &[0x110687, 0x11089f, 0x110acf, 0x110be0, 0x1103fc];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11000e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110687 => { let v = r.multilingual()?; r.set(&mut e0, v, 1671); }
0x11089f => { let v = r.multilingual()?; r.set(&mut e1, v, 2207); }
0x110acf => { let v = r.string()?; r.set(&mut e2, v, 2767); }
0x110be0 => { let v = AnyTrafficRegulation::read(r)?; e3.extend(v); }
0x1103fc => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1020); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1671);
r.required(&e1, 2207);
let v = Self {
actor: e0,
issuing_authority: e1,
regulation_id: e2,
traffic_regulation: e3,
activated_regulation_extension: e4,
};
r.close();
Ok(v)
}
}
impl ActivatedRegulation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.actor {
Some(v) => { w.multilingual("tro:actor", v)?; }
None => return Err(w.missing("tro:actor")),
}
match &self.issuing_authority {
Some(v) => { w.multilingual("tro:issuingAuthority", v)?; }
None => return Err(w.missing("tro:issuingAuthority")),
}
if let Some(v) = &self.regulation_id { w.max_len("regulationId", v, 1024)?; w.leaf("tro:regulationId", v)?; }
w.count("tro:trafficRegulation", self.traffic_regulation.len(), 1, usize::MAX)?;
for v in &self.traffic_regulation { v.write(w, "tro:trafficRegulation")?; }
if let Some(v) = &self.activated_regulation_extension { w.extension("tro:_activatedRegulationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AdHocTrafficRegulation {
pub installer: Option<TrafficRegulationInstallerTypeEnum>,
pub traffic_regulation: Vec<AnyTrafficRegulation>,
pub ad_hoc_traffic_regulation_extension: Option<Box<Extension>>,
}
impl AdHocTrafficRegulation {
const FIELDS: &'static [u32] = &[0x11088c, 0x110be0, 0x110401];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110013);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x11088c => { let v = r.enumeration::<TrafficRegulationInstallerTypeEnum>()?; r.set(&mut e0, v, 2188); }
0x110be0 => { let v = AnyTrafficRegulation::read(r)?; e1.extend(v); }
0x110401 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1025); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2188);
let v = Self {
installer: e0,
traffic_regulation: e1,
ad_hoc_traffic_regulation_extension: e2,
};
r.close();
Ok(v)
}
}
impl AdHocTrafficRegulation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.installer {
Some(v) => { w.enumeration("tro:installer", v.literal())?; }
None => return Err(w.missing("tro:installer")),
}
w.count("tro:trafficRegulation", self.traffic_regulation.len(), 1, usize::MAX)?;
for v in &self.traffic_regulation { v.write(w, "tro:trafficRegulation")?; }
if let Some(v) = &self.ad_hoc_traffic_regulation_extension { w.extension("tro:_adHocTrafficRegulationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AdHocTrafficRegulations {
pub ad_hoc_traffic_regulation: Vec<AdHocTrafficRegulation>,
pub ad_hoc_traffic_regulations_extension: Option<Box<Extension>>,
}
impl AdHocTrafficRegulations {
const FIELDS: &'static [u32] = &[0x11068a, 0x110402];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110014);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x11068a => { let v = Some(AdHocTrafficRegulation::read(r)?); e0.extend(v); }
0x110402 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1026); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
ad_hoc_traffic_regulation: e0,
ad_hoc_traffic_regulations_extension: e1,
};
r.close();
Ok(v)
}
}
impl AdHocTrafficRegulations {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("tro:adHocTrafficRegulation", self.ad_hoc_traffic_regulation.len(), 1, usize::MAX)?;
for v in &self.ad_hoc_traffic_regulation { v.write(w, "tro:adHocTrafficRegulation", "", "")?; }
if let Some(v) = &self.ad_hoc_traffic_regulations_extension { w.extension("tro:_adHocTrafficRegulationsExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AdvisorySpeed {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub speed_limit_extension: Option<Box<Extension>>,
pub numerical_value: Option<com::NonNegativeInteger>,
pub unit_of_measure: Option<UnitOfSpeedEnum>,
pub numercial_speed_value_extension: Option<Box<Extension>>,
pub advisory_speed_extension: Option<Box<Extension>>,
}
impl AdvisorySpeed {
const FIELDS: &'static [u32] = &[0x110629, 0x1105c8, 0x110992, 0x110c09, 0x110508, 0x110406];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110018);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x1105c8 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1480); }
0x110992 => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2450); }
0x110c09 => { let v = r.enumeration::<UnitOfSpeedEnum>()?; r.set(&mut e3, v, 3081); }
0x110508 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1288); }
0x110406 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1030); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2450);
r.required(&e3, 3081);
let v = Self {
type_of_regulation_extension: e0,
speed_limit_extension: e1,
numerical_value: e2,
unit_of_measure: e3,
numercial_speed_value_extension: e4,
advisory_speed_extension: e5,
};
r.close();
Ok(v)
}
}
impl AdvisorySpeed {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.speed_limit_extension { w.extension("tro:_speedLimitExtension", v)?; }
match &self.numerical_value {
Some(v) => { w.leaf("tro:numericalValue", v)?; }
None => return Err(w.missing("tro:numericalValue")),
}
match &self.unit_of_measure {
Some(v) => { w.enumeration("tro:unitOfMeasure", v.literal())?; }
None => return Err(w.missing("tro:unitOfMeasure")),
}
if let Some(v) = &self.numercial_speed_value_extension { w.extension("tro:_numercialSpeedValueExtension", v)?; }
if let Some(v) = &self.advisory_speed_extension { w.extension("tro:_advisorySpeedExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlternateRoadOrCarriagewayOrLaneLayout {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub road_or_carriageway_or_lane_layout_type: Option<RoadOrCarriagewayOrLaneLayoutType>,
pub road_or_carriageway_or_lane_status: Option<RoadOrCarriagewayOrLaneStatus>,
pub temporary_markings: Option<com::Boolean>,
pub new_layout: Option<loc::NetworkLocation>,
pub speed_limit: Option<SpeedLimit>,
pub alternate_road_or_carriageway_or_lane_layout_extension: Option<Box<Extension>>,
}
impl AlternateRoadOrCarriagewayOrLaneLayout {
const FIELDS: &'static [u32] = &[0x110629, 0x110afa, 0x110afc, 0x110baa, 0x110957, 0x110b63, 0x110417];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11002a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110afa => { let v = r.enumeration::<RoadOrCarriagewayOrLaneLayoutType>()?; r.set(&mut e1, v, 2810); }
0x110afc => { let v = r.enumeration::<RoadOrCarriagewayOrLaneStatus>()?; r.set(&mut e2, v, 2812); }
0x110baa => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2986); }
0x110957 => { let v = loc::NetworkLocation::read(r)?; r.set(&mut e4, v, 2391); }
0x110b63 => { let v = SpeedLimit::read(r)?; r.set(&mut e5, v, 2915); }
0x110417 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1047); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2812);
let v = Self {
type_of_regulation_extension: e0,
road_or_carriageway_or_lane_layout_type: e1,
road_or_carriageway_or_lane_status: e2,
temporary_markings: e3,
new_layout: e4,
speed_limit: e5,
alternate_road_or_carriageway_or_lane_layout_extension: e6,
};
r.close();
Ok(v)
}
}
impl AlternateRoadOrCarriagewayOrLaneLayout {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.road_or_carriageway_or_lane_layout_type { w.enumeration("tro:roadOrCarriagewayOrLaneLayoutType", v.literal())?; }
match &self.road_or_carriageway_or_lane_status {
Some(v) => { w.enumeration("tro:roadOrCarriagewayOrLaneStatus", v.literal())?; }
None => return Err(w.missing("tro:roadOrCarriagewayOrLaneStatus")),
}
if let Some(v) = &self.temporary_markings { w.leaf("tro:temporaryMarkings", v)?; }
if let Some(v) = &self.new_layout { v.write(w, "tro:newLayout")?; }
if let Some(v) = &self.speed_limit { v.write(w, "tro:speedLimit")?; }
if let Some(v) = &self.alternate_road_or_carriageway_or_lane_layout_extension { w.extension("tro:_alternateRoadOrCarriagewayOrLaneLayoutExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AmbientWarning {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub warning_extension: Option<Box<Extension>>,
pub ambient_warning_type: Option<AmbientWarningTypeEnum>,
pub ambient_warning_extension: Option<Box<Extension>>,
}
impl AmbientWarning {
const FIELDS: &'static [u32] = &[0x110629, 0x110656, 0x1106b7, 0x11041b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11002e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110656 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1622); }
0x1106b7 => { let v = r.enumeration::<AmbientWarningTypeEnum>()?; r.set(&mut e2, v, 1719); }
0x11041b => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1051); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1719);
let v = Self {
type_of_regulation_extension: e0,
warning_extension: e1,
ambient_warning_type: e2,
ambient_warning_extension: e3,
};
r.close();
Ok(v)
}
}
impl AmbientWarning {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.warning_extension { w.extension("tro:_warningExtension", v)?; }
match &self.ambient_warning_type {
Some(v) => { w.enumeration("tro:ambientWarningType", v.literal())?; }
None => return Err(w.missing("tro:ambientWarningType")),
}
if let Some(v) = &self.ambient_warning_extension { w.extension("tro:_ambientWarningExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct CompulsoryMinSpeed {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub speed_limit_extension: Option<Box<Extension>>,
pub numerical_value: Option<com::NonNegativeInteger>,
pub unit_of_measure: Option<UnitOfSpeedEnum>,
pub numercial_speed_value_extension: Option<Box<Extension>>,
pub compulsory_min_speed_extension: Option<Box<Extension>>,
}
impl CompulsoryMinSpeed {
const FIELDS: &'static [u32] = &[0x110629, 0x1105c8, 0x110992, 0x110c09, 0x110508, 0x110441];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110055);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x1105c8 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1480); }
0x110992 => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2450); }
0x110c09 => { let v = r.enumeration::<UnitOfSpeedEnum>()?; r.set(&mut e3, v, 3081); }
0x110508 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1288); }
0x110441 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1089); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2450);
r.required(&e3, 3081);
let v = Self {
type_of_regulation_extension: e0,
speed_limit_extension: e1,
numerical_value: e2,
unit_of_measure: e3,
numercial_speed_value_extension: e4,
compulsory_min_speed_extension: e5,
};
r.close();
Ok(v)
}
}
impl CompulsoryMinSpeed {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.speed_limit_extension { w.extension("tro:_speedLimitExtension", v)?; }
match &self.numerical_value {
Some(v) => { w.leaf("tro:numericalValue", v)?; }
None => return Err(w.missing("tro:numericalValue")),
}
match &self.unit_of_measure {
Some(v) => { w.enumeration("tro:unitOfMeasure", v.literal())?; }
None => return Err(w.missing("tro:unitOfMeasure")),
}
if let Some(v) = &self.numercial_speed_value_extension { w.extension("tro:_numercialSpeedValueExtension", v)?; }
if let Some(v) = &self.compulsory_min_speed_extension { w.extension("tro:_compulsoryMinSpeedExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ConditionReference {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub reference: Option<Box<com::VersionedReference>>,
pub condition_reference_extension: Option<Box<Extension>>,
}
impl ConditionReference {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110aba, 0x110443];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110057);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e4, v.map(Box::new), 2746); }
0x110443 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1091); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2746);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
reference: e4,
condition_reference_extension: e5,
};
r.close();
Ok(v)
}
}
impl ConditionReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.reference {
Some(v) => { v.write(w, "tro:reference", "", " targetClass=\"tro:PredefinedCondition\"")?; }
None => return Err(w.missing("tro:reference")),
}
if let Some(v) = &self.condition_reference_extension { w.extension("tro:_conditionReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ConditionSet {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub operator: Option<ConditionOperator>,
pub conditions: Vec<Condition>,
pub condition_set_extension: Option<Box<Extension>>,
}
impl ConditionSet {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x1109d2, 0x110732, 0x110444];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110058);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x1109d2 => { let v = r.enumeration::<ConditionOperator>()?; r.set(&mut e4, v, 2514); }
0x110732 => { let v = Condition::read(r)?; e5.extend(v); }
0x110444 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1092); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2514);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
operator: e4,
conditions: e5,
condition_set_extension: e6,
};
r.close();
Ok(v)
}
}
impl ConditionSet {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.operator {
Some(v) => { w.enumeration("tro:operator", v.literal())?; }
None => return Err(w.missing("tro:operator")),
}
w.count("tro:conditions", self.conditions.len(), 1, usize::MAX)?;
for v in &self.conditions { v.write(w, "tro:conditions")?; }
if let Some(v) = &self.condition_set_extension { w.extension("tro:_conditionSetExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DirectionRestriction {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub direction_to_be_followed: Option<DirectionRestrictionTypeEnum>,
pub respect_bicycle: Option<com::Boolean>,
pub respect_pedestrian: Option<com::Boolean>,
pub respect_motorised_personal_transport_devices: Option<com::Boolean>,
pub direction_restriction_extension: Option<Box<Extension>>,
}
impl DirectionRestriction {
const FIELDS: &'static [u32] = &[0x110629, 0x11078f, 0x110ae8, 0x110aeb, 0x110aea, 0x11046b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110080);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x11078f => { let v = r.enumeration::<DirectionRestrictionTypeEnum>()?; r.set(&mut e1, v, 1935); }
0x110ae8 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2792); }
0x110aeb => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2795); }
0x110aea => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2794); }
0x11046b => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1131); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1935);
let v = Self {
type_of_regulation_extension: e0,
direction_to_be_followed: e1,
respect_bicycle: e2,
respect_pedestrian: e3,
respect_motorised_personal_transport_devices: e4,
direction_restriction_extension: e5,
};
r.close();
Ok(v)
}
}
impl DirectionRestriction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
match &self.direction_to_be_followed {
Some(v) => { w.enumeration("tro:directionToBeFollowed", v.literal())?; }
None => return Err(w.missing("tro:directionToBeFollowed")),
}
if let Some(v) = &self.respect_bicycle { w.leaf("tro:respectBicycle", v)?; }
if let Some(v) = &self.respect_pedestrian { w.leaf("tro:respectPedestrian", v)?; }
if let Some(v) = &self.respect_motorised_personal_transport_devices { w.leaf("tro:respectMotorisedPersonalTransportDevices", v)?; }
if let Some(v) = &self.direction_restriction_extension { w.extension("tro:_directionRestrictionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DriverCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub driver_characteristics_type: Option<DriverCharacteristicsTypeEnum>,
pub licence_characteristics: Option<LicenceCharacteristicsEnum>,
pub age_of_driver: Option<Box<comx::NonNegativeIntegerComparison>>,
pub time_drivers_licence_held: Option<Box<TimeDriversLicenceHeld>>,
pub driver_condition_extension: Option<Box<Extension>>,
}
impl DriverCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x1107a8, 0x1108c8, 0x11069b, 0x110bb6, 0x110474];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110089);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x1107a8 => { let v = r.enumeration::<DriverCharacteristicsTypeEnum>()?; r.set(&mut e4, v, 1960); }
0x1108c8 => { let v = r.enumeration::<LicenceCharacteristicsEnum>()?; r.set(&mut e5, v, 2248); }
0x11069b => { let v = Some(comx::NonNegativeIntegerComparison::read(r)?); r.set(&mut e6, v.map(Box::new), 1691); }
0x110bb6 => { let v = Some(TimeDriversLicenceHeld::read(r)?); r.set(&mut e7, v.map(Box::new), 2998); }
0x110474 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1140); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
driver_characteristics_type: e4,
licence_characteristics: e5,
age_of_driver: e6,
time_drivers_licence_held: e7,
driver_condition_extension: e8,
};
r.close();
Ok(v)
}
}
impl DriverCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
if let Some(v) = &self.driver_characteristics_type { w.enumeration("tro:driverCharacteristicsType", v.literal())?; }
if let Some(v) = &self.licence_characteristics { w.enumeration("tro:licenceCharacteristics", v.literal())?; }
if let Some(v) = &self.age_of_driver { v.write(w, "tro:ageOfDriver", "", "")?; }
if let Some(v) = &self.time_drivers_licence_held { v.write(w, "tro:timeDriversLicenceHeld", "", "")?; }
if let Some(v) = &self.driver_condition_extension { w.extension("tro:_driverConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DynamicTrafficManagement {
pub issuing_authority: Option<MultilingualString>,
pub dynamic_traffic_regulation_extension: Option<Box<Extension>>,
pub traffic_regulation: Vec<AnyTrafficRegulation>,
pub dynamic_traffic_management_extension: Option<Box<Extension>>,
}
impl DynamicTrafficManagement {
const FIELDS: &'static [u32] = &[0x11089f, 0x110478, 0x110be0, 0x110477];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11008c);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x11089f => { let v = r.multilingual()?; r.set(&mut e0, v, 2207); }
0x110478 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1144); }
0x110be0 => { let v = AnyTrafficRegulation::read(r)?; e2.extend(v); }
0x110477 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1143); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
issuing_authority: e0,
dynamic_traffic_regulation_extension: e1,
traffic_regulation: e2,
dynamic_traffic_management_extension: e3,
};
r.close();
Ok(v)
}
}
impl DynamicTrafficManagement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.issuing_authority { w.multilingual("tro:issuingAuthority", v)?; }
if let Some(v) = &self.dynamic_traffic_regulation_extension { w.extension("tro:_dynamicTrafficRegulationExtension", v)?; }
for v in &self.traffic_regulation { v.write(w, "tro:trafficRegulation")?; }
if let Some(v) = &self.dynamic_traffic_management_extension { w.extension("tro:_dynamicTrafficManagementExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DynamicTrafficRegulations {
pub dynamic_traffic_regulation: Vec<DynamicTrafficRegulation>,
pub dynamic_traffic_regulations_extension: Option<Box<Extension>>,
}
impl DynamicTrafficRegulations {
const FIELDS: &'static [u32] = &[0x1107af, 0x110479];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11008e);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1107af => { let v = DynamicTrafficRegulation::read(r)?; e0.extend(v); }
0x110479 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1145); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
dynamic_traffic_regulation: e0,
dynamic_traffic_regulations_extension: e1,
};
r.close();
Ok(v)
}
}
impl DynamicTrafficRegulations {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("tro:dynamicTrafficRegulation", self.dynamic_traffic_regulation.len(), 1, usize::MAX)?;
for v in &self.dynamic_traffic_regulation { v.write(w, "tro:dynamicTrafficRegulation")?; }
if let Some(v) = &self.dynamic_traffic_regulations_extension { w.extension("tro:_dynamicTrafficRegulationsExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GddPictogramIdentification {
pub country: Option<com::CountryCode>,
pub service_category: Option<GddServiceCategoryEnum>,
pub pictogram_category_code: Option<GddPictogramCategoryCode>,
pub gdd_pictogram_identification_extension: Option<Box<Extension>>,
}
impl GddPictogramIdentification {
const FIELDS: &'static [u32] = &[0x110747, 0x110b31, 0x110a34, 0x1104a2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1100b8);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110747 => { let v = r.string()?; r.set(&mut e0, v, 1863); }
0x110b31 => { let v = r.enumeration::<GddServiceCategoryEnum>()?; r.set(&mut e1, v, 2865); }
0x110a34 => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2612); }
0x1104a2 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1186); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1863);
r.required(&e1, 2865);
r.required(&e2, 2612);
let v = Self {
country: e0,
service_category: e1,
pictogram_category_code: e2,
gdd_pictogram_identification_extension: e3,
};
r.close();
Ok(v)
}
}
impl GddPictogramIdentification {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.country {
Some(v) => { w.max_len("country", v, 2)?; w.leaf("tro:country", v)?; }
None => return Err(w.missing("tro:country")),
}
match &self.service_category {
Some(v) => { w.enumeration("tro:serviceCategory", v.literal())?; }
None => return Err(w.missing("tro:serviceCategory")),
}
match &self.pictogram_category_code {
Some(v) => { w.range("pictogramCategoryCode", *v, 1, u64::MAX)?; w.leaf("tro:pictogramCategoryCode", v)?; }
None => return Err(w.missing("tro:pictogramCategoryCode")),
}
if let Some(v) = &self.gdd_pictogram_identification_extension { w.extension("tro:_gddPictogramIdentificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct HardShoulderRunningRestriction {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub clear_hard_shoulder: Option<com::Boolean>,
pub hard_shoulder_running_active: Option<com::Boolean>,
pub hard_shoulder_running_restriction_extension: Option<Box<Extension>>,
}
impl HardShoulderRunningRestriction {
const FIELDS: &'static [u32] = &[0x110629, 0x11071c, 0x110851, 0x1104b8];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1100ce);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x11071c => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1820); }
0x110851 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2129); }
0x1104b8 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1208); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_regulation_extension: e0,
clear_hard_shoulder: e1,
hard_shoulder_running_active: e2,
hard_shoulder_running_restriction_extension: e3,
};
r.close();
Ok(v)
}
}
impl HardShoulderRunningRestriction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.clear_hard_shoulder { w.leaf("tro:clearHardShoulder", v)?; }
if let Some(v) = &self.hard_shoulder_running_active { w.leaf("tro:hardShoulderRunningActive", v)?; }
if let Some(v) = &self.hard_shoulder_running_restriction_extension { w.extension("tro:_hardShoulderRunningRestrictionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LegalBasis {
pub name: Option<MultilingualString>,
pub version: Option<String>,
pub date: Option<Date>,
pub legal_basis_extension: Option<Box<Extension>>,
}
impl LegalBasis {
const FIELDS: &'static [u32] = &[0x110949, 0x110c4d, 0x11075a, 0x1104d4];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1100eb);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x110c4d => { let v = r.string()?; r.set(&mut e1, v, 3149); }
0x11075a => { let v = r.value::<Date>()?; r.set(&mut e2, v, 1882); }
0x1104d4 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1236); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2377);
let v = Self {
name: e0,
version: e1,
date: e2,
legal_basis_extension: e3,
};
r.close();
Ok(v)
}
}
impl LegalBasis {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.name {
Some(v) => { w.multilingual("tro:name", v)?; }
None => return Err(w.missing("tro:name")),
}
if let Some(v) = &self.version { w.max_len("version", v, 1024)?; w.leaf("tro:version", v)?; }
if let Some(v) = &self.date { w.leaf("tro:date", v)?; }
if let Some(v) = &self.legal_basis_extension { w.extension("tro:_legalBasisExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LocationCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub implemented_location: Option<loc::LocationReference>,
pub location_by_order: Option<loc::LocationReference>,
pub traffic_impact_location: Option<loc::LocationReference>,
pub location_condition_extension: Option<Box<Extension>>,
}
impl LocationCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x11087e, 0x1108dd, 0x110bde, 0x1104de];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1100f6);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x11087e => { let v = loc::LocationReference::read(r)?; r.set(&mut e4, v, 2174); }
0x1108dd => { let v = loc::LocationReference::read(r)?; r.set(&mut e5, v, 2269); }
0x110bde => { let v = loc::LocationReference::read(r)?; r.set(&mut e6, v, 3038); }
0x1104de => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1246); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
implemented_location: e4,
location_by_order: e5,
traffic_impact_location: e6,
location_condition_extension: e7,
};
r.close();
Ok(v)
}
}
impl LocationCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
if let Some(v) = &self.implemented_location { v.write(w, "tro:implementedLocation")?; }
if let Some(v) = &self.location_by_order { v.write(w, "tro:locationByOrder")?; }
if let Some(v) = &self.traffic_impact_location { v.write(w, "tro:trafficImpactLocation")?; }
if let Some(v) = &self.location_condition_extension { w.extension("tro:_locationConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MainSign {
pub picture_of_road_sign: Option<com::Base64Binary>,
pub url_to_road_sign: Option<com::Url>,
pub national_sign_id: Option<String>,
pub description: Option<MultilingualString>,
pub gdd_pictogram_identification: Option<Box<GddPictogramIdentification>>,
pub location_of_sign: Vec<loc::AnyPointLocation>,
pub road_sign_extension: Option<Box<Extension>>,
pub main_sign_extension: Option<Box<Extension>>,
}
impl MainSign {
const FIELDS: &'static [u32] = &[0x110a3e, 0x110c14, 0x110952, 0x110777, 0x110839, 0x1108e6, 0x1105a8, 0x1104e4];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1100fb);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110a3e => { let v = r.base64()?; r.set(&mut e0, v, 2622); }
0x110c14 => { let v = r.string()?; r.set(&mut e1, v, 3092); }
0x110952 => { let v = r.string()?; r.set(&mut e2, v, 2386); }
0x110777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x110839 => { let v = Some(GddPictogramIdentification::read(r)?); r.set(&mut e4, v.map(Box::new), 2105); }
0x1108e6 => { let v = loc::AnyPointLocation::read(r)?; e5.extend(v); }
0x1105a8 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1448); }
0x1104e4 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1252); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
picture_of_road_sign: e0,
url_to_road_sign: e1,
national_sign_id: e2,
description: e3,
gdd_pictogram_identification: e4,
location_of_sign: e5,
road_sign_extension: e6,
main_sign_extension: e7,
};
r.close();
Ok(v)
}
}
impl MainSign {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.picture_of_road_sign { w.leaf("tro:pictureOfRoadSign", v)?; }
if let Some(v) = &self.url_to_road_sign { w.leaf("tro:urlToRoadSign", v)?; }
if let Some(v) = &self.national_sign_id { w.max_len("nationalSignID", v, 1024)?; w.leaf("tro:nationalSignID", v)?; }
if let Some(v) = &self.description { w.multilingual("tro:description", v)?; }
if let Some(v) = &self.gdd_pictogram_identification { v.write(w, "tro:gddPictogramIdentification", "", "")?; }
for v in &self.location_of_sign { v.write(w, "tro:locationOfSign")?; }
if let Some(v) = &self.road_sign_extension { w.extension("tro:_roadSignExtension", v)?; }
if let Some(v) = &self.main_sign_extension { w.extension("tro:_mainSignExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MandatoryRoadOrCarriagewayOrLaneUsage {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub exclusive: Option<com::Boolean>,
pub respect_mandatory_traffic: Option<com::Boolean>,
pub segregated_lanes: Option<com::Boolean>,
pub contraflow_lane: Option<com::Boolean>,
pub other_obligation: Option<MultilingualString>,
pub mandatory_road_or_carriageway_or_lane_usage_extension: Option<Box<Extension>>,
}
impl MandatoryRoadOrCarriagewayOrLaneUsage {
const FIELDS: &'static [u32] = &[0x110629, 0x1107f4, 0x110ae9, 0x110b23, 0x11073b, 0x1109e9, 0x1104e8];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1100ff);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x1107f4 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2036); }
0x110ae9 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2793); }
0x110b23 => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2851); }
0x11073b => { let v = r.value::<bool>()?; r.set(&mut e4, v, 1851); }
0x1109e9 => { let v = r.multilingual()?; r.set(&mut e5, v, 2537); }
0x1104e8 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1256); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_regulation_extension: e0,
exclusive: e1,
respect_mandatory_traffic: e2,
segregated_lanes: e3,
contraflow_lane: e4,
other_obligation: e5,
mandatory_road_or_carriageway_or_lane_usage_extension: e6,
};
r.close();
Ok(v)
}
}
impl MandatoryRoadOrCarriagewayOrLaneUsage {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.exclusive { w.leaf("tro:exclusive", v)?; }
if let Some(v) = &self.respect_mandatory_traffic { w.leaf("tro:respectMandatoryTraffic", v)?; }
if let Some(v) = &self.segregated_lanes { w.leaf("tro:segregatedLanes", v)?; }
if let Some(v) = &self.contraflow_lane { w.leaf("tro:contraflowLane", v)?; }
if let Some(v) = &self.other_obligation { w.multilingual("tro:otherObligation", v)?; }
if let Some(v) = &self.mandatory_road_or_carriageway_or_lane_usage_extension { w.extension("tro:_mandatoryRoadOrCarriagewayOrLaneUsageExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MaxSpeedLimit {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub speed_limit_extension: Option<Box<Extension>>,
pub numerical_value: Option<com::NonNegativeInteger>,
pub unit_of_measure: Option<UnitOfSpeedEnum>,
pub numercial_speed_value_extension: Option<Box<Extension>>,
pub max_speed_limit_extension: Option<Box<Extension>>,
}
impl MaxSpeedLimit {
const FIELDS: &'static [u32] = &[0x110629, 0x1105c8, 0x110992, 0x110c09, 0x110508, 0x1104ea];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110101);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x1105c8 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1480); }
0x110992 => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2450); }
0x110c09 => { let v = r.enumeration::<UnitOfSpeedEnum>()?; r.set(&mut e3, v, 3081); }
0x110508 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1288); }
0x1104ea => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1258); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2450);
r.required(&e3, 3081);
let v = Self {
type_of_regulation_extension: e0,
speed_limit_extension: e1,
numerical_value: e2,
unit_of_measure: e3,
numercial_speed_value_extension: e4,
max_speed_limit_extension: e5,
};
r.close();
Ok(v)
}
}
impl MaxSpeedLimit {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.speed_limit_extension { w.extension("tro:_speedLimitExtension", v)?; }
match &self.numerical_value {
Some(v) => { w.leaf("tro:numericalValue", v)?; }
None => return Err(w.missing("tro:numericalValue")),
}
match &self.unit_of_measure {
Some(v) => { w.enumeration("tro:unitOfMeasure", v.literal())?; }
None => return Err(w.missing("tro:unitOfMeasure")),
}
if let Some(v) = &self.numercial_speed_value_extension { w.extension("tro:_numercialSpeedValueExtension", v)?; }
if let Some(v) = &self.max_speed_limit_extension { w.extension("tro:_maxSpeedLimitExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MinimumDistanceRestriction {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub value: Option<com::MetresAsFloat>,
pub minimum_distance_restriction_extension: Option<Box<Extension>>,
}
impl MinimumDistanceRestriction {
const FIELDS: &'static [u32] = &[0x110629, 0x110c2c, 0x1104f7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11010e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110c2c => { let v = r.value::<f32>()?; r.set(&mut e1, v, 3116); }
0x1104f7 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1271); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 3116);
let v = Self {
type_of_regulation_extension: e0,
value: e1,
minimum_distance_restriction_extension: e2,
};
r.close();
Ok(v)
}
}
impl MinimumDistanceRestriction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
match &self.value {
Some(v) => { w.leaf("tro:value", v)?; }
None => return Err(w.missing("tro:value")),
}
if let Some(v) = &self.minimum_distance_restriction_extension { w.extension("tro:_minimumDistanceRestrictionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct NonVehicularRoadUserCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub non_vehicular_road_user: Option<NonVehicularRoadUserTypeEnum>,
pub non_vehicular_road_user_condition_extension: Option<Box<Extension>>,
}
impl NonVehicularRoadUserCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110967, 0x110503];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11011e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110967 => { let v = r.enumeration::<NonVehicularRoadUserTypeEnum>()?; r.set(&mut e4, v, 2407); }
0x110503 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1283); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2407);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
non_vehicular_road_user: e4,
non_vehicular_road_user_condition_extension: e5,
};
r.close();
Ok(v)
}
}
impl NonVehicularRoadUserCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.non_vehicular_road_user {
Some(v) => { w.enumeration("tro:nonVehicularRoadUser", v.literal())?; }
None => return Err(w.missing("tro:nonVehicularRoadUser")),
}
if let Some(v) = &self.non_vehicular_road_user_condition_extension { w.extension("tro:_nonVehicularRoadUserConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OccupantCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub number_of_occupants: Option<Box<comx::NonNegativeIntegerComparison>>,
pub occupant_condition_extension: Option<Box<Extension>>,
}
impl OccupantCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x11097b, 0x110510];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11012b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x11097b => { let v = Some(comx::NonNegativeIntegerComparison::read(r)?); r.set(&mut e4, v.map(Box::new), 2427); }
0x110510 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1296); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2427);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
number_of_occupants: e4,
occupant_condition_extension: e5,
};
r.close();
Ok(v)
}
}
impl OccupantCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.number_of_occupants {
Some(v) => { v.write(w, "tro:numberOfOccupants", "", "")?; }
None => return Err(w.missing("tro:numberOfOccupants")),
}
if let Some(v) = &self.occupant_condition_extension { w.extension("tro:_occupantConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PermitInformation {
pub id: Option<String>,
pub version: Option<String>,
pub application_required: Option<com::Boolean>,
pub description: Option<MultilingualString>,
pub location_related_permit: Option<com::Boolean>,
pub max_duration_of_permit: Option<Duration>,
pub where_to_apply_for_permit: Option<com::Url>,
pub where_to_call_for_permit: Option<String>,
pub permit_owner_type: Option<PermitOwnerTypeEnum>,
pub url_for_further_information: Option<com::Url>,
pub how_to_obtain_permit: Option<MultilingualString>,
pub permit_type: Option<PermitTypeEnum>,
pub disabled_parking_permit: Option<com::Boolean>,
pub minimum_time_to_next_entry: Option<Duration>,
pub permit_subject_to_fee: Option<Box<PermitSubjectToFee>>,
pub location_of_registration_machine: Vec<loc::AnyPointLocation>,
pub permit_information_extension: Option<Box<Extension>>,
}
impl PermitInformation {
const FIELDS: &'static [u32] = &[0x1106cb, 0x110777, 0x1108e9, 0x1108fa, 0x110c73, 0x110c74, 0x110a24, 0x110c0f, 0x110868, 0x110a26, 0x110790, 0x11093c, 0x110a25, 0x1108e4, 0x110551];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11016e);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = Vec::new();
let mut e14 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1106cb => { let v = r.value::<bool>()?; r.set(&mut e0, v, 1739); }
0x110777 => { let v = r.multilingual()?; r.set(&mut e1, v, 1911); }
0x1108e9 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2281); }
0x1108fa => { let v = r.string()?; r.set(&mut e3, v, 2298); }
0x110c73 => { let v = r.string()?; r.set(&mut e4, v, 3187); }
0x110c74 => { let v = r.string()?; r.set(&mut e5, v, 3188); }
0x110a24 => { let v = r.enumeration::<PermitOwnerTypeEnum>()?; r.set(&mut e6, v, 2596); }
0x110c0f => { let v = r.string()?; r.set(&mut e7, v, 3087); }
0x110868 => { let v = r.multilingual()?; r.set(&mut e8, v, 2152); }
0x110a26 => { let v = r.enumeration::<PermitTypeEnum>()?; r.set(&mut e9, v, 2598); }
0x110790 => { let v = r.value::<bool>()?; r.set(&mut e10, v, 1936); }
0x11093c => { let v = r.string()?; r.set(&mut e11, v, 2364); }
0x110a25 => { let v = Some(PermitSubjectToFee::read(r)?); r.set(&mut e12, v.map(Box::new), 2597); }
0x1108e4 => { let v = loc::AnyPointLocation::read(r)?; e13.extend(v); }
0x110551 => { let v = r.raw()?; r.set(&mut e14, v.map(Box::new), 1361); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e9, 2598);
let v = Self {
id: a0,
version: a1,
application_required: e0,
description: e1,
location_related_permit: e2,
max_duration_of_permit: e3,
where_to_apply_for_permit: e4,
where_to_call_for_permit: e5,
permit_owner_type: e6,
url_for_further_information: e7,
how_to_obtain_permit: e8,
permit_type: e9,
disabled_parking_permit: e10,
minimum_time_to_next_entry: e11,
permit_subject_to_fee: e12,
location_of_registration_machine: e13,
permit_information_extension: e14,
};
r.close();
Ok(v)
}
}
impl PermitInformation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.application_required { w.leaf("tro:applicationRequired", v)?; }
if let Some(v) = &self.description { w.multilingual("tro:description", v)?; }
if let Some(v) = &self.location_related_permit { w.leaf("tro:locationRelatedPermit", v)?; }
if let Some(v) = &self.max_duration_of_permit { w.pattern("maxDurationOfPermit", v, Pattern::Duration)?; w.leaf("tro:maxDurationOfPermit", v)?; }
if let Some(v) = &self.where_to_apply_for_permit { w.leaf("tro:whereToApplyForPermit", v)?; }
if let Some(v) = &self.where_to_call_for_permit { w.max_len("whereToCallForPermit", v, 1024)?; w.leaf("tro:whereToCallForPermit", v)?; }
if let Some(v) = &self.permit_owner_type { w.enumeration("tro:permitOwnerType", v.literal())?; }
if let Some(v) = &self.url_for_further_information { w.leaf("tro:urlForFurtherInformation", v)?; }
if let Some(v) = &self.how_to_obtain_permit { w.multilingual("tro:howToObtainPermit", v)?; }
match &self.permit_type {
Some(v) => { w.enumeration("tro:permitType", v.literal())?; }
None => return Err(w.missing("tro:permitType")),
}
if let Some(v) = &self.disabled_parking_permit { w.leaf("tro:disabledParkingPermit", v)?; }
if let Some(v) = &self.minimum_time_to_next_entry { w.pattern("minimumTimeToNextEntry", v, Pattern::Duration)?; w.leaf("tro:minimumTimeToNextEntry", v)?; }
if let Some(v) = &self.permit_subject_to_fee { v.write(w, "tro:permitSubjectToFee", "", "")?; }
for v in &self.location_of_registration_machine { v.write(w, "tro:locationOfRegistrationMachine")?; }
if let Some(v) = &self.permit_information_extension { w.extension("tro:_permitInformationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PermitSubjectToFee {
pub amount_due: Option<AmountOfMoney>,
pub maximum_access_duration: Option<Duration>,
pub payment_information: Option<com::Url>,
pub permit_subject_to_fee_extension: Option<Box<Extension>>,
}
impl PermitSubjectToFee {
const FIELDS: &'static [u32] = &[0x1106b9, 0x110905, 0x110a11, 0x110552];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11016f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1106b9 => { let v = r.value::<Decimal>()?; r.set(&mut e0, v, 1721); }
0x110905 => { let v = r.string()?; r.set(&mut e1, v, 2309); }
0x110a11 => { let v = r.string()?; r.set(&mut e2, v, 2577); }
0x110552 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1362); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
amount_due: e0,
maximum_access_duration: e1,
payment_information: e2,
permit_subject_to_fee_extension: e3,
};
r.close();
Ok(v)
}
}
impl PermitSubjectToFee {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.amount_due { w.digits("amountDue", v, 8, 2)?; w.leaf("tro:amountDue", v)?; }
if let Some(v) = &self.maximum_access_duration { w.pattern("maximumAccessDuration", v, Pattern::Duration)?; w.leaf("tro:maximumAccessDuration", v)?; }
if let Some(v) = &self.payment_information { w.leaf("tro:paymentInformation", v)?; }
if let Some(v) = &self.permit_subject_to_fee_extension { w.extension("tro:_permitSubjectToFeeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedCondition {
pub id: Option<String>,
pub version: Option<String>,
pub condition: Option<Condition>,
pub predefined_condition_extension: Option<Box<Extension>>,
}
impl PredefinedCondition {
const FIELDS: &'static [u32] = &[0x110731, 0x11056f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11018b);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110731 => { let v = Condition::read(r)?; r.set(&mut e0, v, 1841); }
0x11056f => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1391); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1841);
let v = Self {
id: a0,
version: a1,
condition: e0,
predefined_condition_extension: e1,
};
r.close();
Ok(v)
}
}
impl PredefinedCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
match &self.condition {
Some(v) => { v.write(w, "tro:condition")?; }
None => return Err(w.missing("tro:condition")),
}
if let Some(v) = &self.predefined_condition_extension { w.extension("tro:_predefinedConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedConditionPublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub id: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub predefined_condition: Vec<PredefinedCondition>,
pub predefined_condition_publication_extension: Option<Box<Extension>>,
}
impl PredefinedConditionPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x110a5e, 0x110570];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11018d);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
let a6 = r.req_attr(2159);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x110a5e => { let v = Some(PredefinedCondition::read(r)?); e5.extend(v); }
0x110570 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1392); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
id: a6,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
predefined_condition: e5,
predefined_condition_publication_extension: e6,
};
r.close();
Ok(v)
}
}
impl PredefinedConditionPublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
w.count("tro:predefinedCondition", self.predefined_condition.len(), 1, usize::MAX)?;
for v in &self.predefined_condition { v.write(w, "tro:predefinedCondition", "", "")?; }
if let Some(v) = &self.predefined_condition_publication_extension { w.extension("tro:_predefinedConditionPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PriorityRule {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub priority_rule_type: Vec<PriorityRuleTypeEnum>,
pub respect_bicycle: Option<com::Boolean>,
pub give_way_to: Vec<com::VehicleCharacteristics>,
pub priority_rule_extension: Option<Box<Extension>>,
}
impl PriorityRule {
const FIELDS: &'static [u32] = &[0x110629, 0x110a7a, 0x110ae8, 0x110843, 0x11057b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110198);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110a7a => { let v = r.enumeration::<PriorityRuleTypeEnum>()?; e1.extend(v); }
0x110ae8 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2792); }
0x110843 => { let v = Some(com::VehicleCharacteristics::read(r)?); e3.extend(v); }
0x11057b => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1403); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_regulation_extension: e0,
priority_rule_type: e1,
respect_bicycle: e2,
give_way_to: e3,
priority_rule_extension: e4,
};
r.close();
Ok(v)
}
}
impl PriorityRule {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
w.count("tro:priorityRuleType", self.priority_rule_type.len(), 1, usize::MAX)?;
for v in &self.priority_rule_type { w.enumeration("tro:priorityRuleType", v.literal())?; }
if let Some(v) = &self.respect_bicycle { w.leaf("tro:respectBicycle", v)?; }
for v in &self.give_way_to { v.write(w, "tro:giveWayTo", "", "")?; }
if let Some(v) = &self.priority_rule_extension { w.extension("tro:_priorityRuleExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ProhibitionOfOvertaking {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub do_not_overtake: Vec<com::VehicleCharacteristics>,
pub permission_to_overtake: Vec<com::VehicleCharacteristics>,
pub prohibition_of_overtaking_extension: Option<Box<Extension>>,
}
impl ProhibitionOfOvertaking {
const FIELDS: &'static [u32] = &[0x110629, 0x1107a7, 0x110a21, 0x11057c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110199);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x1107a7 => { let v = Some(com::VehicleCharacteristics::read(r)?); e1.extend(v); }
0x110a21 => { let v = Some(com::VehicleCharacteristics::read(r)?); e2.extend(v); }
0x11057c => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1404); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_regulation_extension: e0,
do_not_overtake: e1,
permission_to_overtake: e2,
prohibition_of_overtaking_extension: e3,
};
r.close();
Ok(v)
}
}
impl ProhibitionOfOvertaking {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
for v in &self.do_not_overtake { v.write(w, "tro:doNotOvertake", "", "")?; }
for v in &self.permission_to_overtake { v.write(w, "tro:permissionToOvertake", "", "")?; }
if let Some(v) = &self.prohibition_of_overtaking_extension { w.extension("tro:_prohibitionOfOvertakingExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RequiredPermitCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub identifier: Option<String>,
pub issuing_authority: Option<MultilingualString>,
pub permit_characteristics: Option<Box<com::VersionedReference>>,
pub permit_type: Vec<PermitTypeEnum>,
pub required_permit_condition_extension: Option<Box<Extension>>,
}
impl RequiredPermitCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110870, 0x11089f, 0x110a22, 0x110a26, 0x110599];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101b7);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110870 => { let v = r.string()?; r.set(&mut e4, v, 2160); }
0x11089f => { let v = r.multilingual()?; r.set(&mut e5, v, 2207); }
0x110a22 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e6, v.map(Box::new), 2594); }
0x110a26 => { let v = r.enumeration::<PermitTypeEnum>()?; e7.extend(v); }
0x110599 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1433); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
identifier: e4,
issuing_authority: e5,
permit_characteristics: e6,
permit_type: e7,
required_permit_condition_extension: e8,
};
r.close();
Ok(v)
}
}
impl RequiredPermitCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
if let Some(v) = &self.identifier { w.max_len("identifier", v, 1024)?; w.leaf("tro:identifier", v)?; }
if let Some(v) = &self.issuing_authority { w.multilingual("tro:issuingAuthority", v)?; }
if let Some(v) = &self.permit_characteristics { v.write(w, "tro:permitCharacteristics", "", " targetClass=\"tro:PermitInformation\"")?; }
w.count("tro:permitType", self.permit_type.len(), 1, usize::MAX)?;
for v in &self.permit_type { w.enumeration("tro:permitType", v.literal())?; }
if let Some(v) = &self.required_permit_condition_extension { w.extension("tro:_requiredPermitConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Rerouting {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub rerouting_extension: Option<Box<Extension>>,
}
impl Rerouting {
const FIELDS: &'static [u32] = &[0x110629, 0x11059a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101b8);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x11059a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1434); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_regulation_extension: e0,
rerouting_extension: e1,
};
r.close();
Ok(v)
}
}
impl Rerouting {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.rerouting_extension { w.extension("tro:_reroutingExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RoadCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub road_type: Option<RoadTypeEnum>,
pub road_condition_extension: Option<Box<Extension>>,
}
impl RoadCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110b02, 0x1105a2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101c1);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110b02 => { let v = r.enumeration::<RoadTypeEnum>()?; r.set(&mut e4, v, 2818); }
0x1105a2 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1442); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2818);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
road_type: e4,
road_condition_extension: e5,
};
r.close();
Ok(v)
}
}
impl RoadCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.road_type {
Some(v) => { w.enumeration("tro:roadType", v.literal())?; }
None => return Err(w.missing("tro:roadType")),
}
if let Some(v) = &self.road_condition_extension { w.extension("tro:_roadConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RoadWarning {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub warning_extension: Option<Box<Extension>>,
pub road_warning_type: Option<RoadWarningTypeEnum>,
pub road_warning_extension: Option<Box<Extension>>,
}
impl RoadWarning {
const FIELDS: &'static [u32] = &[0x110629, 0x110656, 0x110b03, 0x1105ac];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101cb);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110656 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1622); }
0x110b03 => { let v = r.enumeration::<RoadWarningTypeEnum>()?; r.set(&mut e2, v, 2819); }
0x1105ac => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1452); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2819);
let v = Self {
type_of_regulation_extension: e0,
warning_extension: e1,
road_warning_type: e2,
road_warning_extension: e3,
};
r.close();
Ok(v)
}
}
impl RoadWarning {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.warning_extension { w.extension("tro:_warningExtension", v)?; }
match &self.road_warning_type {
Some(v) => { w.enumeration("tro:roadWarningType", v.literal())?; }
None => return Err(w.missing("tro:roadWarningType")),
}
if let Some(v) = &self.road_warning_extension { w.extension("tro:_roadWarningExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RushHourLaneRestriction {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub clear_rush_hour_lane: Option<com::Boolean>,
pub rush_hour_lane_open: Option<com::Boolean>,
pub rush_hour_lane_restriction_extension: Option<Box<Extension>>,
}
impl RushHourLaneRestriction {
const FIELDS: &'static [u32] = &[0x110629, 0x11071d, 0x110b17, 0x1105b2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101d1);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x11071d => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1821); }
0x110b17 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2839); }
0x1105b2 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1458); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_regulation_extension: e0,
clear_rush_hour_lane: e1,
rush_hour_lane_open: e2,
rush_hour_lane_restriction_extension: e3,
};
r.close();
Ok(v)
}
}
impl RushHourLaneRestriction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.clear_rush_hour_lane { w.leaf("tro:clearRushHourLane", v)?; }
if let Some(v) = &self.rush_hour_lane_open { w.leaf("tro:rushHourLaneOpen", v)?; }
if let Some(v) = &self.rush_hour_lane_restriction_extension { w.extension("tro:_rushHourLaneRestrictionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct StandingOrParkingCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub standing_or_parking_condition_type: Option<StandingOrParkingConditionTypeEnum>,
pub standing_or_parking_condition_extension: Option<Box<Extension>>,
}
impl StandingOrParkingCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110b6b, 0x1105cd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101ed);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110b6b => { let v = r.enumeration::<StandingOrParkingConditionTypeEnum>()?; r.set(&mut e4, v, 2923); }
0x1105cd => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1485); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2923);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
standing_or_parking_condition_type: e4,
standing_or_parking_condition_extension: e5,
};
r.close();
Ok(v)
}
}
impl StandingOrParkingCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.standing_or_parking_condition_type {
Some(v) => { w.enumeration("tro:standingOrParkingConditionType", v.literal())?; }
None => return Err(w.missing("tro:standingOrParkingConditionType")),
}
if let Some(v) = &self.standing_or_parking_condition_extension { w.extension("tro:_standingOrParkingConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct StandingOrParkingControl {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub standing_or_parking_control_type: Option<StandingOrParkingControlTypeEnum>,
pub permitted_standing_time: Option<Duration>,
pub permitted_parking_time: Option<Duration>,
pub paid_parking: Option<com::Boolean>,
pub standing_or_parking_control_extension: Option<Box<Extension>>,
}
impl StandingOrParkingControl {
const FIELDS: &'static [u32] = &[0x110629, 0x110b6c, 0x110a29, 0x110a28, 0x1109fc, 0x1105ce];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101ee);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110b6c => { let v = r.enumeration::<StandingOrParkingControlTypeEnum>()?; r.set(&mut e1, v, 2924); }
0x110a29 => { let v = r.string()?; r.set(&mut e2, v, 2601); }
0x110a28 => { let v = r.string()?; r.set(&mut e3, v, 2600); }
0x1109fc => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2556); }
0x1105ce => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1486); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2924);
let v = Self {
type_of_regulation_extension: e0,
standing_or_parking_control_type: e1,
permitted_standing_time: e2,
permitted_parking_time: e3,
paid_parking: e4,
standing_or_parking_control_extension: e5,
};
r.close();
Ok(v)
}
}
impl StandingOrParkingControl {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
match &self.standing_or_parking_control_type {
Some(v) => { w.enumeration("tro:standingOrParkingControlType", v.literal())?; }
None => return Err(w.missing("tro:standingOrParkingControlType")),
}
if let Some(v) = &self.permitted_standing_time { w.pattern("permittedStandingTime", v, Pattern::Duration)?; w.leaf("tro:permittedStandingTime", v)?; }
if let Some(v) = &self.permitted_parking_time { w.pattern("permittedParkingTime", v, Pattern::Duration)?; w.leaf("tro:permittedParkingTime", v)?; }
if let Some(v) = &self.paid_parking { w.leaf("tro:paidParking", v)?; }
if let Some(v) = &self.standing_or_parking_control_extension { w.extension("tro:_standingOrParkingControlExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SteepHill {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub warning_extension: Option<Box<Extension>>,
pub road_gradient_value: Option<com::Percentage>,
pub steep_hill_direction_type: Option<SteepHillDirectionTypeEnum>,
pub steep_hill_extension: Option<Box<Extension>>,
}
impl SteepHill {
const FIELDS: &'static [u32] = &[0x110629, 0x110656, 0x110af4, 0x110b7e, 0x1105d4];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1101f4);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110656 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1622); }
0x110af4 => { let v = r.value::<f32>()?; r.set(&mut e2, v, 2804); }
0x110b7e => { let v = r.enumeration::<SteepHillDirectionTypeEnum>()?; r.set(&mut e3, v, 2942); }
0x1105d4 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1492); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2804);
r.required(&e3, 2942);
let v = Self {
type_of_regulation_extension: e0,
warning_extension: e1,
road_gradient_value: e2,
steep_hill_direction_type: e3,
steep_hill_extension: e4,
};
r.close();
Ok(v)
}
}
impl SteepHill {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.warning_extension { w.extension("tro:_warningExtension", v)?; }
match &self.road_gradient_value {
Some(v) => { w.leaf("tro:roadGradientValue", v)?; }
None => return Err(w.missing("tro:roadGradientValue")),
}
match &self.steep_hill_direction_type {
Some(v) => { w.enumeration("tro:steepHillDirectionType", v.literal())?; }
None => return Err(w.missing("tro:steepHillDirectionType")),
}
if let Some(v) = &self.steep_hill_extension { w.extension("tro:_steepHillExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryPanel {
pub picture_of_road_sign: Option<com::Base64Binary>,
pub url_to_road_sign: Option<com::Url>,
pub national_sign_id: Option<String>,
pub description: Option<MultilingualString>,
pub gdd_pictogram_identification: Option<Box<GddPictogramIdentification>>,
pub location_of_sign: Vec<loc::AnyPointLocation>,
pub road_sign_extension: Option<Box<Extension>>,
pub supplementary_panel_extension: Option<Box<Extension>>,
}
impl SupplementaryPanel {
const FIELDS: &'static [u32] = &[0x110a3e, 0x110c14, 0x110952, 0x110777, 0x110839, 0x1108e6, 0x1105a8, 0x1105e1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110201);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110a3e => { let v = r.base64()?; r.set(&mut e0, v, 2622); }
0x110c14 => { let v = r.string()?; r.set(&mut e1, v, 3092); }
0x110952 => { let v = r.string()?; r.set(&mut e2, v, 2386); }
0x110777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x110839 => { let v = Some(GddPictogramIdentification::read(r)?); r.set(&mut e4, v.map(Box::new), 2105); }
0x1108e6 => { let v = loc::AnyPointLocation::read(r)?; e5.extend(v); }
0x1105a8 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1448); }
0x1105e1 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1505); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
picture_of_road_sign: e0,
url_to_road_sign: e1,
national_sign_id: e2,
description: e3,
gdd_pictogram_identification: e4,
location_of_sign: e5,
road_sign_extension: e6,
supplementary_panel_extension: e7,
};
r.close();
Ok(v)
}
}
impl SupplementaryPanel {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.picture_of_road_sign { w.leaf("tro:pictureOfRoadSign", v)?; }
if let Some(v) = &self.url_to_road_sign { w.leaf("tro:urlToRoadSign", v)?; }
if let Some(v) = &self.national_sign_id { w.max_len("nationalSignID", v, 1024)?; w.leaf("tro:nationalSignID", v)?; }
if let Some(v) = &self.description { w.multilingual("tro:description", v)?; }
if let Some(v) = &self.gdd_pictogram_identification { v.write(w, "tro:gddPictogramIdentification", "", "")?; }
for v in &self.location_of_sign { v.write(w, "tro:locationOfSign")?; }
if let Some(v) = &self.road_sign_extension { w.extension("tro:_roadSignExtension", v)?; }
if let Some(v) = &self.supplementary_panel_extension { w.extension("tro:_supplementaryPanelExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TemporaryTrafficRegulationOrder {
pub id: Option<String>,
pub version: Option<String>,
pub description: Option<MultilingualString>,
pub issuing_authority: Option<MultilingualString>,
pub reason: Vec<ReasonForRegulationEnum>,
pub regulation_id: Option<String>,
pub status: Option<TrafficRegulationOrderStatusEnum>,
pub implemented_validity: Option<Box<com::Validity>>,
pub validity_by_order: Option<Box<com::Validity>>,
pub implemented_location: Option<loc::LocationReference>,
pub location_by_order: Option<loc::LocationReference>,
pub traffic_regulation: Vec<AnyTrafficRegulation>,
pub legal_basis: Option<Box<LegalBasis>>,
pub traffic_regulation_order_extension: Option<Box<Extension>>,
pub overruled_traffic_regulation_order: Vec<com::VersionedReference>,
pub temporary_traffic_regulation_order_extension: Option<Box<Extension>>,
}
impl TemporaryTrafficRegulationOrder {
const FIELDS: &'static [u32] = &[0x110777, 0x11089f, 0x110ab1, 0x110acf, 0x110b73, 0x11087f, 0x110c27, 0x11087e, 0x1108dd, 0x110be0, 0x1108c2, 0x110618, 0x1109f6, 0x1105ec];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11020e);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = Vec::new();
let mut e13 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110777 => { let v = r.multilingual()?; r.set(&mut e0, v, 1911); }
0x11089f => { let v = r.multilingual()?; r.set(&mut e1, v, 2207); }
0x110ab1 => { let v = r.enumeration::<ReasonForRegulationEnum>()?; e2.extend(v); }
0x110acf => { let v = r.string()?; r.set(&mut e3, v, 2767); }
0x110b73 => { let v = r.enumeration::<TrafficRegulationOrderStatusEnum>()?; r.set(&mut e4, v, 2931); }
0x11087f => { let v = Some(com::Validity::read(r)?); r.set(&mut e5, v.map(Box::new), 2175); }
0x110c27 => { let v = Some(com::Validity::read(r)?); r.set(&mut e6, v.map(Box::new), 3111); }
0x11087e => { let v = loc::LocationReference::read(r)?; r.set(&mut e7, v, 2174); }
0x1108dd => { let v = loc::LocationReference::read(r)?; r.set(&mut e8, v, 2269); }
0x110be0 => { let v = AnyTrafficRegulation::read(r)?; e9.extend(v); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e10, v.map(Box::new), 2242); }
0x110618 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1560); }
0x1109f6 => { let v = Some(com::VersionedReference::read(r)?); e12.extend(v); }
0x1105ec => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1516); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2207);
r.required(&e3, 2767);
r.required(&e4, 2931);
let v = Self {
id: a0,
version: a1,
description: e0,
issuing_authority: e1,
reason: e2,
regulation_id: e3,
status: e4,
implemented_validity: e5,
validity_by_order: e6,
implemented_location: e7,
location_by_order: e8,
traffic_regulation: e9,
legal_basis: e10,
traffic_regulation_order_extension: e11,
overruled_traffic_regulation_order: e12,
temporary_traffic_regulation_order_extension: e13,
};
r.close();
Ok(v)
}
}
impl TemporaryTrafficRegulationOrder {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.description { w.multilingual("tro:description", v)?; }
match &self.issuing_authority {
Some(v) => { w.multilingual("tro:issuingAuthority", v)?; }
None => return Err(w.missing("tro:issuingAuthority")),
}
for v in &self.reason { w.enumeration("tro:reason", v.literal())?; }
match &self.regulation_id {
Some(v) => { w.max_len("regulationId", v, 1024)?; w.leaf("tro:regulationId", v)?; }
None => return Err(w.missing("tro:regulationId")),
}
match &self.status {
Some(v) => { w.enumeration("tro:status", v.literal())?; }
None => return Err(w.missing("tro:status")),
}
if let Some(v) = &self.implemented_validity { v.write(w, "tro:implementedValidity", "", "")?; }
if let Some(v) = &self.validity_by_order { v.write(w, "tro:validityByOrder", "", "")?; }
if let Some(v) = &self.implemented_location { v.write(w, "tro:implementedLocation")?; }
if let Some(v) = &self.location_by_order { v.write(w, "tro:locationByOrder")?; }
w.count("tro:trafficRegulation", self.traffic_regulation.len(), 1, usize::MAX)?;
for v in &self.traffic_regulation { v.write(w, "tro:trafficRegulation")?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.traffic_regulation_order_extension { w.extension("tro:_trafficRegulationOrderExtension", v)?; }
for v in &self.overruled_traffic_regulation_order { v.write(w, "tro:overruledTrafficRegulationOrder", "", " targetClass=\"tro:TrafficRegulationOrder\"")?; }
if let Some(v) = &self.temporary_traffic_regulation_order_extension { w.extension("tro:_temporaryTrafficRegulationOrderExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TimeDriversLicenceHeld {
pub value: Option<Duration>,
pub comparison_operator: Option<com::ComparisonOperatorEnum>,
pub time_drivers_licence_held_extension: Option<Box<Extension>>,
}
impl TimeDriversLicenceHeld {
const FIELDS: &'static [u32] = &[0x110c2c, 0x11072a, 0x1105f3];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110215);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110c2c => { let v = r.string()?; r.set(&mut e0, v, 3116); }
0x11072a => { let v = r.enumeration::<com::ComparisonOperatorEnum>()?; r.set(&mut e1, v, 1834); }
0x1105f3 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1523); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3116);
r.required(&e1, 1834);
let v = Self {
value: e0,
comparison_operator: e1,
time_drivers_licence_held_extension: e2,
};
r.close();
Ok(v)
}
}
impl TimeDriversLicenceHeld {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.value {
Some(v) => { w.pattern("value", v, Pattern::Duration)?; w.leaf("tro:value", v)?; }
None => return Err(w.missing("tro:value")),
}
match &self.comparison_operator {
Some(v) => { w.enumeration("tro:comparisonOperator", v.literal())?; }
None => return Err(w.missing("tro:comparisonOperator")),
}
if let Some(v) = &self.time_drivers_licence_held_extension { w.extension("tro:_timeDriversLicenceHeldExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TimeValidityCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub implemented_validity: Option<Box<com::Validity>>,
pub validity_by_order: Option<Box<com::Validity>>,
pub time_validity_condition_extension: Option<Box<Extension>>,
}
impl TimeValidityCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x11087f, 0x110c27, 0x1105f6];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110218);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x11087f => { let v = Some(com::Validity::read(r)?); r.set(&mut e4, v.map(Box::new), 2175); }
0x110c27 => { let v = Some(com::Validity::read(r)?); r.set(&mut e5, v.map(Box::new), 3111); }
0x1105f6 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1526); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
implemented_validity: e4,
validity_by_order: e5,
time_validity_condition_extension: e6,
};
r.close();
Ok(v)
}
}
impl TimeValidityCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
if let Some(v) = &self.implemented_validity { v.write(w, "tro:implementedValidity", "", "")?; }
if let Some(v) = &self.validity_by_order { v.write(w, "tro:validityByOrder", "", "")?; }
if let Some(v) = &self.time_validity_condition_extension { w.extension("tro:_timeValidityConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficAhead {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub warning_extension: Option<Box<Extension>>,
pub traffic_ahead_type: Option<TrafficAheadTypeEnum>,
pub traffic_ahead_extension: Option<Box<Extension>>,
}
impl TrafficAhead {
const FIELDS: &'static [u32] = &[0x110629, 0x110656, 0x110bda, 0x11060e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110230);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x110656 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1622); }
0x110bda => { let v = r.enumeration::<TrafficAheadTypeEnum>()?; r.set(&mut e2, v, 3034); }
0x11060e => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1550); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 3034);
let v = Self {
type_of_regulation_extension: e0,
warning_extension: e1,
traffic_ahead_type: e2,
traffic_ahead_extension: e3,
};
r.close();
Ok(v)
}
}
impl TrafficAhead {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.warning_extension { w.extension("tro:_warningExtension", v)?; }
match &self.traffic_ahead_type {
Some(v) => { w.enumeration("tro:trafficAheadType", v.literal())?; }
None => return Err(w.missing("tro:trafficAheadType")),
}
if let Some(v) = &self.traffic_ahead_extension { w.extension("tro:_trafficAheadExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficRegulation {
pub id: Option<String>,
pub version: Option<String>,
pub status: Option<ActivationStatusEnum>,
pub road_sign: Vec<RoadSign>,
pub type_of_regulation: Vec<TypeOfRegulation>,
pub condition: Option<Condition>,
pub permit_information: Vec<PermitInformation>,
pub traffic_regulation_extension: Option<Box<Extension>>,
}
impl TrafficRegulation {
const FIELDS: &'static [u32] = &[0x110b73, 0x110aff, 0x110c02, 0x110731, 0x110a23, 0x110617];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110238);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110b73 => { let v = r.enumeration::<ActivationStatusEnum>()?; r.set(&mut e0, v, 2931); }
0x110aff => { let v = RoadSign::read(r)?; e1.extend(v); }
0x110c02 => { let v = TypeOfRegulation::read(r)?; e2.extend(v); }
0x110731 => { let v = Condition::read(r)?; r.set(&mut e3, v, 1841); }
0x110a23 => { let v = Some(PermitInformation::read(r)?); e4.extend(v); }
0x110617 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1559); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
status: e0,
road_sign: e1,
type_of_regulation: e2,
condition: e3,
permit_information: e4,
traffic_regulation_extension: e5,
};
r.close();
Ok(v)
}
}
impl TrafficRegulation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.status { w.enumeration("tro:status", v.literal())?; }
for v in &self.road_sign { v.write(w, "tro:roadSign")?; }
for v in &self.type_of_regulation { v.write(w, "tro:typeOfRegulation")?; }
if let Some(v) = &self.condition { v.write(w, "tro:condition")?; }
for v in &self.permit_information { v.write(w, "tro:permitInformation", "", "")?; }
if let Some(v) = &self.traffic_regulation_extension { w.extension("tro:_trafficRegulationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficRegulationOrder {
pub id: Option<String>,
pub version: Option<String>,
pub description: Option<MultilingualString>,
pub issuing_authority: Option<MultilingualString>,
pub reason: Vec<ReasonForRegulationEnum>,
pub regulation_id: Option<String>,
pub status: Option<TrafficRegulationOrderStatusEnum>,
pub implemented_validity: Option<Box<com::Validity>>,
pub validity_by_order: Option<Box<com::Validity>>,
pub implemented_location: Option<loc::LocationReference>,
pub location_by_order: Option<loc::LocationReference>,
pub traffic_regulation: Vec<AnyTrafficRegulation>,
pub legal_basis: Option<Box<LegalBasis>>,
pub traffic_regulation_order_extension: Option<Box<Extension>>,
}
impl TrafficRegulationOrder {
const FIELDS: &'static [u32] = &[0x110777, 0x11089f, 0x110ab1, 0x110acf, 0x110b73, 0x11087f, 0x110c27, 0x11087e, 0x1108dd, 0x110be0, 0x1108c2, 0x110618];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11023a);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110777 => { let v = r.multilingual()?; r.set(&mut e0, v, 1911); }
0x11089f => { let v = r.multilingual()?; r.set(&mut e1, v, 2207); }
0x110ab1 => { let v = r.enumeration::<ReasonForRegulationEnum>()?; e2.extend(v); }
0x110acf => { let v = r.string()?; r.set(&mut e3, v, 2767); }
0x110b73 => { let v = r.enumeration::<TrafficRegulationOrderStatusEnum>()?; r.set(&mut e4, v, 2931); }
0x11087f => { let v = Some(com::Validity::read(r)?); r.set(&mut e5, v.map(Box::new), 2175); }
0x110c27 => { let v = Some(com::Validity::read(r)?); r.set(&mut e6, v.map(Box::new), 3111); }
0x11087e => { let v = loc::LocationReference::read(r)?; r.set(&mut e7, v, 2174); }
0x1108dd => { let v = loc::LocationReference::read(r)?; r.set(&mut e8, v, 2269); }
0x110be0 => { let v = AnyTrafficRegulation::read(r)?; e9.extend(v); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e10, v.map(Box::new), 2242); }
0x110618 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1560); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2207);
r.required(&e3, 2767);
r.required(&e4, 2931);
let v = Self {
id: a0,
version: a1,
description: e0,
issuing_authority: e1,
reason: e2,
regulation_id: e3,
status: e4,
implemented_validity: e5,
validity_by_order: e6,
implemented_location: e7,
location_by_order: e8,
traffic_regulation: e9,
legal_basis: e10,
traffic_regulation_order_extension: e11,
};
r.close();
Ok(v)
}
}
impl TrafficRegulationOrder {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.description { w.multilingual("tro:description", v)?; }
match &self.issuing_authority {
Some(v) => { w.multilingual("tro:issuingAuthority", v)?; }
None => return Err(w.missing("tro:issuingAuthority")),
}
for v in &self.reason { w.enumeration("tro:reason", v.literal())?; }
match &self.regulation_id {
Some(v) => { w.max_len("regulationId", v, 1024)?; w.leaf("tro:regulationId", v)?; }
None => return Err(w.missing("tro:regulationId")),
}
match &self.status {
Some(v) => { w.enumeration("tro:status", v.literal())?; }
None => return Err(w.missing("tro:status")),
}
if let Some(v) = &self.implemented_validity { v.write(w, "tro:implementedValidity", "", "")?; }
if let Some(v) = &self.validity_by_order { v.write(w, "tro:validityByOrder", "", "")?; }
if let Some(v) = &self.implemented_location { v.write(w, "tro:implementedLocation")?; }
if let Some(v) = &self.location_by_order { v.write(w, "tro:locationByOrder")?; }
w.count("tro:trafficRegulation", self.traffic_regulation.len(), 1, usize::MAX)?;
for v in &self.traffic_regulation { v.write(w, "tro:trafficRegulation")?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.traffic_regulation_order_extension { w.extension("tro:_trafficRegulationOrderExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficRegulationPublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub id: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub predefined_condition_publication_reference: Vec<com::VersionedReference>,
pub traffic_regulations_from_competent_authorities: Option<Box<TrafficRegulationsFromCompetentAuthorities>>,
pub traffic_regulations_by_authorised_actors: Option<Box<TrafficRegulationsByAuthorisedActors>>,
pub ad_hoc_traffic_regulations: Option<Box<AdHocTrafficRegulations>>,
pub dynamic_traffic_regulations: Option<Box<DynamicTrafficRegulations>>,
pub traffic_regulations_without_traffic_regulation_order: Option<Box<TrafficRegulationsWithoutTrafficRegulationOrder>>,
pub traffic_regulation_publication_extension: Option<Box<Extension>>,
}
impl TrafficRegulationPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x110a5f, 0x110be4, 0x110be3, 0x11068b, 0x1107b0, 0x110be5, 0x110619];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11023b);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
let a6 = r.req_attr(2159);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x110a5f => { let v = Some(com::VersionedReference::read(r)?); e5.extend(v); }
0x110be4 => { let v = Some(TrafficRegulationsFromCompetentAuthorities::read(r)?); r.set(&mut e6, v.map(Box::new), 3044); }
0x110be3 => { let v = Some(TrafficRegulationsByAuthorisedActors::read(r)?); r.set(&mut e7, v.map(Box::new), 3043); }
0x11068b => { let v = Some(AdHocTrafficRegulations::read(r)?); r.set(&mut e8, v.map(Box::new), 1675); }
0x1107b0 => { let v = Some(DynamicTrafficRegulations::read(r)?); r.set(&mut e9, v.map(Box::new), 1968); }
0x110be5 => { let v = Some(TrafficRegulationsWithoutTrafficRegulationOrder::read(r)?); r.set(&mut e10, v.map(Box::new), 3045); }
0x110619 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1561); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
id: a6,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
predefined_condition_publication_reference: e5,
traffic_regulations_from_competent_authorities: e6,
traffic_regulations_by_authorised_actors: e7,
ad_hoc_traffic_regulations: e8,
dynamic_traffic_regulations: e9,
traffic_regulations_without_traffic_regulation_order: e10,
traffic_regulation_publication_extension: e11,
};
r.close();
Ok(v)
}
}
impl TrafficRegulationPublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
for v in &self.predefined_condition_publication_reference { v.write(w, "tro:predefinedConditionPublicationReference", "", " targetClass=\"tro:PredefinedConditionPublication\"")?; }
if let Some(v) = &self.traffic_regulations_from_competent_authorities { v.write(w, "tro:trafficRegulationsFromCompetentAuthorities", "", "")?; }
if let Some(v) = &self.traffic_regulations_by_authorised_actors { v.write(w, "tro:trafficRegulationsByAuthorisedActors", "", "")?; }
if let Some(v) = &self.ad_hoc_traffic_regulations { v.write(w, "tro:adHocTrafficRegulations", "", "")?; }
if let Some(v) = &self.dynamic_traffic_regulations { v.write(w, "tro:dynamicTrafficRegulations", "", "")?; }
if let Some(v) = &self.traffic_regulations_without_traffic_regulation_order { v.write(w, "tro:trafficRegulationsWithoutTrafficRegulationOrder", "", "")?; }
if let Some(v) = &self.traffic_regulation_publication_extension { w.extension("tro:_trafficRegulationPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficRegulationsByAuthorisedActors {
pub activated_regulation: Vec<ActivatedRegulation>,
pub traffic_regulations_by_authorised_actors_extension: Option<Box<Extension>>,
}
impl TrafficRegulationsByAuthorisedActors {
const FIELDS: &'static [u32] = &[0x11067a, 0x11061a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11023c);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x11067a => { let v = Some(ActivatedRegulation::read(r)?); e0.extend(v); }
0x11061a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1562); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
activated_regulation: e0,
traffic_regulations_by_authorised_actors_extension: e1,
};
r.close();
Ok(v)
}
}
impl TrafficRegulationsByAuthorisedActors {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("tro:activatedRegulation", self.activated_regulation.len(), 1, usize::MAX)?;
for v in &self.activated_regulation { v.write(w, "tro:activatedRegulation", "", "")?; }
if let Some(v) = &self.traffic_regulations_by_authorised_actors_extension { w.extension("tro:_trafficRegulationsByAuthorisedActorsExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficRegulationsFromCompetentAuthorities {
pub traffic_regulation_order: Vec<AnyTrafficRegulationOrder>,
pub traffic_regulations_from_competent_authorities_extension: Option<Box<Extension>>,
}
impl TrafficRegulationsFromCompetentAuthorities {
const FIELDS: &'static [u32] = &[0x110be1, 0x11061b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11023d);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110be1 => { let v = AnyTrafficRegulationOrder::read(r)?; e0.extend(v); }
0x11061b => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1563); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
traffic_regulation_order: e0,
traffic_regulations_from_competent_authorities_extension: e1,
};
r.close();
Ok(v)
}
}
impl TrafficRegulationsFromCompetentAuthorities {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("tro:trafficRegulationOrder", self.traffic_regulation_order.len(), 1, usize::MAX)?;
for v in &self.traffic_regulation_order { v.write(w, "tro:trafficRegulationOrder")?; }
if let Some(v) = &self.traffic_regulations_from_competent_authorities_extension { w.extension("tro:_trafficRegulationsFromCompetentAuthoritiesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficRegulationsWithoutTrafficRegulationOrder {
pub traffic_regulation: Vec<AnyTrafficRegulation>,
pub traffic_regulations_without_traffic_regulation_order_extension: Option<Box<Extension>>,
}
impl TrafficRegulationsWithoutTrafficRegulationOrder {
const FIELDS: &'static [u32] = &[0x110be0, 0x11061c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11023e);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110be0 => { let v = AnyTrafficRegulation::read(r)?; e0.extend(v); }
0x11061c => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1564); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
traffic_regulation: e0,
traffic_regulations_without_traffic_regulation_order_extension: e1,
};
r.close();
Ok(v)
}
}
impl TrafficRegulationsWithoutTrafficRegulationOrder {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("tro:trafficRegulation", self.traffic_regulation.len(), 1, usize::MAX)?;
for v in &self.traffic_regulation { v.write(w, "tro:trafficRegulation")?; }
if let Some(v) = &self.traffic_regulations_without_traffic_regulation_order_extension { w.extension("tro:_trafficRegulationsWithoutTrafficRegulationOrderExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TunnelCategoryCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub tunnel_category_type: Option<ADRTunnelCategoryTypeEnum>,
pub tunnel_category_condition_extension: Option<Box<Extension>>,
}
impl TunnelCategoryCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110bfd, 0x110628];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11024a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110bfd => { let v = r.enumeration::<ADRTunnelCategoryTypeEnum>()?; r.set(&mut e4, v, 3069); }
0x110628 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1576); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 3069);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
tunnel_category_type: e4,
tunnel_category_condition_extension: e5,
};
r.close();
Ok(v)
}
}
impl TunnelCategoryCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.tunnel_category_type {
Some(v) => { w.enumeration("tro:tunnelCategoryType", v.literal())?; }
None => return Err(w.missing("tro:tunnelCategoryType")),
}
if let Some(v) = &self.tunnel_category_condition_extension { w.extension("tro:_tunnelCategoryConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VehicleCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub vehicle_characteristics: Option<Box<com::VehicleCharacteristics>>,
pub vehicle_condition_extension: Option<Box<Extension>>,
}
impl VehicleCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110c30, 0x11063a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11025e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110c30 => { let v = Some(com::VehicleCharacteristics::read(r)?); r.set(&mut e4, v.map(Box::new), 3120); }
0x11063a => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1594); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 3120);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
vehicle_characteristics: e4,
vehicle_condition_extension: e5,
};
r.close();
Ok(v)
}
}
impl VehicleCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.vehicle_characteristics {
Some(v) => { v.write(w, "tro:vehicleCharacteristics", "", "")?; }
None => return Err(w.missing("tro:vehicleCharacteristics")),
}
if let Some(v) = &self.vehicle_condition_extension { w.extension("tro:_vehicleConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct WalkingSpeed {
pub type_of_regulation_extension: Option<Box<Extension>>,
pub speed_limit_extension: Option<Box<Extension>>,
pub walking_speed_extension: Option<Box<Extension>>,
}
impl WalkingSpeed {
const FIELDS: &'static [u32] = &[0x110629, 0x1105c8, 0x110655];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x110279);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110629 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1577); }
0x1105c8 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1480); }
0x110655 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1621); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_regulation_extension: e0,
speed_limit_extension: e1,
walking_speed_extension: e2,
};
r.close();
Ok(v)
}
}
impl WalkingSpeed {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.type_of_regulation_extension { w.extension("tro:_typeOfRegulationExtension", v)?; }
if let Some(v) = &self.speed_limit_extension { w.extension("tro:_speedLimitExtension", v)?; }
if let Some(v) = &self.walking_speed_extension { w.extension("tro:_walkingSpeedExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct WarningPublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub id: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub warning_without_regulation: Vec<WarningWithoutRegulation>,
pub warning_publication_extension: Option<Box<Extension>>,
}
impl WarningPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x110c6c, 0x110657];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11027b);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
let a6 = r.req_attr(2159);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x110c6c => { let v = Some(WarningWithoutRegulation::read(r)?); e5.extend(v); }
0x110657 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1623); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
id: a6,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
warning_without_regulation: e5,
warning_publication_extension: e6,
};
r.close();
Ok(v)
}
}
impl WarningPublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
w.count("tro:warningWithoutRegulation", self.warning_without_regulation.len(), 1, usize::MAX)?;
for v in &self.warning_without_regulation { v.write(w, "tro:warningWithoutRegulation", "", "")?; }
if let Some(v) = &self.warning_publication_extension { w.extension("tro:_warningPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct WarningWithoutRegulation {
pub type_of_warning_without_regulation: Vec<Warning>,
pub condition: Option<Condition>,
pub road_sign: Vec<RoadSign>,
pub warning_without_regulation_extension: Option<Box<Extension>>,
}
impl WarningWithoutRegulation {
const FIELDS: &'static [u32] = &[0x110c05, 0x110731, 0x110aff, 0x110658];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11027c);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110c05 => { let v = Warning::read(r)?; e0.extend(v); }
0x110731 => { let v = Condition::read(r)?; r.set(&mut e1, v, 1841); }
0x110aff => { let v = RoadSign::read(r)?; e2.extend(v); }
0x110658 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1624); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
type_of_warning_without_regulation: e0,
condition: e1,
road_sign: e2,
warning_without_regulation_extension: e3,
};
r.close();
Ok(v)
}
}
impl WarningWithoutRegulation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("tro:typeOfWarningWithoutRegulation", self.type_of_warning_without_regulation.len(), 1, usize::MAX)?;
for v in &self.type_of_warning_without_regulation { v.write(w, "tro:typeOfWarningWithoutRegulation")?; }
if let Some(v) = &self.condition { v.write(w, "tro:condition")?; }
for v in &self.road_sign { v.write(w, "tro:roadSign")?; }
if let Some(v) = &self.warning_without_regulation_extension { w.extension("tro:_warningWithoutRegulationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct WeatherCondition {
pub negate: Option<com::Boolean>,
pub active: Option<com::Boolean>,
pub legal_basis: Option<Box<LegalBasis>>,
pub condition_extension: Option<Box<Extension>>,
pub weather_condition_type: Option<com::WeatherRelatedRoadConditionTypeEnum>,
pub weather_condition_extension: Option<Box<Extension>>,
}
impl WeatherCondition {
const FIELDS: &'static [u32] = &[0x110955, 0x110683, 0x1108c2, 0x110442, 0x110c6e, 0x110659];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x11027d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x110955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x110683 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1667); }
0x1108c2 => { let v = Some(LegalBasis::read(r)?); r.set(&mut e2, v.map(Box::new), 2242); }
0x110442 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1090); }
0x110c6e => { let v = r.enumeration::<com::WeatherRelatedRoadConditionTypeEnum>()?; r.set(&mut e4, v, 3182); }
0x110659 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1625); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 3182);
let v = Self {
negate: e0,
active: e1,
legal_basis: e2,
condition_extension: e3,
weather_condition_type: e4,
weather_condition_extension: e5,
};
r.close();
Ok(v)
}
}
impl WeatherCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tro:negate", v)?; }
if let Some(v) = &self.active { w.leaf("tro:active", v)?; }
if let Some(v) = &self.legal_basis { v.write(w, "tro:legalBasis", "", "")?; }
if let Some(v) = &self.condition_extension { w.extension("tro:_conditionExtension", v)?; }
match &self.weather_condition_type {
Some(v) => { w.enumeration("tro:weatherConditionType", v.literal())?; }
None => return Err(w.missing("tro:weatherConditionType")),
}
if let Some(v) = &self.weather_condition_extension { w.extension("tro:_weatherConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Condition {
NonCodableCondition(Box<cz::NonCodableCondition>),
PeriodCondition(Box<cz::PeriodCondition>),
RetrofittingCondition(Box<cz::RetrofittingCondition>),
TariffCondition(Box<cz::TariffCondition>),
AccessCondition(Box<AccessCondition>),
ConditionReference(Box<ConditionReference>),
ConditionSet(Box<ConditionSet>),
DriverCondition(Box<DriverCondition>),
LocationCondition(Box<LocationCondition>),
NonVehicularRoadUserCondition(Box<NonVehicularRoadUserCondition>),
OccupantCondition(Box<OccupantCondition>),
RequiredPermitCondition(Box<RequiredPermitCondition>),
RoadCondition(Box<RoadCondition>),
StandingOrParkingCondition(Box<StandingOrParkingCondition>),
TimeValidityCondition(Box<TimeValidityCondition>),
TunnelCategoryCondition(Box<TunnelCategoryCondition>),
VehicleCondition(Box<VehicleCondition>),
WeatherCondition(Box<WeatherCondition>),
}
impl Condition {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x50119) => Self::NonCodableCondition(Box::new(cz::NonCodableCondition::read(r)?)),
Some(0x5016c) => Self::PeriodCondition(Box::new(cz::PeriodCondition::read(r)?)),
Some(0x501be) => Self::RetrofittingCondition(Box::new(cz::RetrofittingCondition::read(r)?)),
Some(0x50209) => Self::TariffCondition(Box::new(cz::TariffCondition::read(r)?)),
Some(0x110003) => Self::AccessCondition(Box::new(AccessCondition::read(r)?)),
Some(0x110057) => Self::ConditionReference(Box::new(ConditionReference::read(r)?)),
Some(0x110058) => Self::ConditionSet(Box::new(ConditionSet::read(r)?)),
Some(0x110089) => Self::DriverCondition(Box::new(DriverCondition::read(r)?)),
Some(0x1100f6) => Self::LocationCondition(Box::new(LocationCondition::read(r)?)),
Some(0x11011e) => Self::NonVehicularRoadUserCondition(Box::new(NonVehicularRoadUserCondition::read(r)?)),
Some(0x11012b) => Self::OccupantCondition(Box::new(OccupantCondition::read(r)?)),
Some(0x1101b7) => Self::RequiredPermitCondition(Box::new(RequiredPermitCondition::read(r)?)),
Some(0x1101c1) => Self::RoadCondition(Box::new(RoadCondition::read(r)?)),
Some(0x1101ed) => Self::StandingOrParkingCondition(Box::new(StandingOrParkingCondition::read(r)?)),
Some(0x110218) => Self::TimeValidityCondition(Box::new(TimeValidityCondition::read(r)?)),
Some(0x11024a) => Self::TunnelCategoryCondition(Box::new(TunnelCategoryCondition::read(r)?)),
Some(0x11025e) => Self::VehicleCondition(Box::new(VehicleCondition::read(r)?)),
Some(0x11027d) => Self::WeatherCondition(Box::new(WeatherCondition::read(r)?)),
_ => {
r.unknown_type("Condition")?;
return Ok(None);
}
}))
}
pub fn negate(&self) -> Option<&com::Boolean> {
match self {
Self::NonCodableCondition(v) => v.negate.as_ref(),
Self::PeriodCondition(v) => v.negate.as_ref(),
Self::RetrofittingCondition(v) => v.negate.as_ref(),
Self::TariffCondition(v) => v.negate.as_ref(),
Self::AccessCondition(v) => v.negate.as_ref(),
Self::ConditionReference(v) => v.negate.as_ref(),
Self::ConditionSet(v) => v.negate.as_ref(),
Self::DriverCondition(v) => v.negate.as_ref(),
Self::LocationCondition(v) => v.negate.as_ref(),
Self::NonVehicularRoadUserCondition(v) => v.negate.as_ref(),
Self::OccupantCondition(v) => v.negate.as_ref(),
Self::RequiredPermitCondition(v) => v.negate.as_ref(),
Self::RoadCondition(v) => v.negate.as_ref(),
Self::StandingOrParkingCondition(v) => v.negate.as_ref(),
Self::TimeValidityCondition(v) => v.negate.as_ref(),
Self::TunnelCategoryCondition(v) => v.negate.as_ref(),
Self::VehicleCondition(v) => v.negate.as_ref(),
Self::WeatherCondition(v) => v.negate.as_ref(),
}
}
pub fn active(&self) -> Option<&com::Boolean> {
match self {
Self::NonCodableCondition(v) => v.active.as_ref(),
Self::PeriodCondition(v) => v.active.as_ref(),
Self::RetrofittingCondition(v) => v.active.as_ref(),
Self::TariffCondition(v) => v.active.as_ref(),
Self::AccessCondition(v) => v.active.as_ref(),
Self::ConditionReference(v) => v.active.as_ref(),
Self::ConditionSet(v) => v.active.as_ref(),
Self::DriverCondition(v) => v.active.as_ref(),
Self::LocationCondition(v) => v.active.as_ref(),
Self::NonVehicularRoadUserCondition(v) => v.active.as_ref(),
Self::OccupantCondition(v) => v.active.as_ref(),
Self::RequiredPermitCondition(v) => v.active.as_ref(),
Self::RoadCondition(v) => v.active.as_ref(),
Self::StandingOrParkingCondition(v) => v.active.as_ref(),
Self::TimeValidityCondition(v) => v.active.as_ref(),
Self::TunnelCategoryCondition(v) => v.active.as_ref(),
Self::VehicleCondition(v) => v.active.as_ref(),
Self::WeatherCondition(v) => v.active.as_ref(),
}
}
pub fn legal_basis(&self) -> Option<&LegalBasis> {
match self {
Self::NonCodableCondition(v) => v.legal_basis.as_deref(),
Self::PeriodCondition(v) => v.legal_basis.as_deref(),
Self::RetrofittingCondition(v) => v.legal_basis.as_deref(),
Self::TariffCondition(v) => v.legal_basis.as_deref(),
Self::AccessCondition(v) => v.legal_basis.as_deref(),
Self::ConditionReference(v) => v.legal_basis.as_deref(),
Self::ConditionSet(v) => v.legal_basis.as_deref(),
Self::DriverCondition(v) => v.legal_basis.as_deref(),
Self::LocationCondition(v) => v.legal_basis.as_deref(),
Self::NonVehicularRoadUserCondition(v) => v.legal_basis.as_deref(),
Self::OccupantCondition(v) => v.legal_basis.as_deref(),
Self::RequiredPermitCondition(v) => v.legal_basis.as_deref(),
Self::RoadCondition(v) => v.legal_basis.as_deref(),
Self::StandingOrParkingCondition(v) => v.legal_basis.as_deref(),
Self::TimeValidityCondition(v) => v.legal_basis.as_deref(),
Self::TunnelCategoryCondition(v) => v.legal_basis.as_deref(),
Self::VehicleCondition(v) => v.legal_basis.as_deref(),
Self::WeatherCondition(v) => v.legal_basis.as_deref(),
}
}
pub fn condition_extension(&self) -> Option<&Extension> {
match self {
Self::NonCodableCondition(v) => v.condition_extension.as_deref(),
Self::PeriodCondition(v) => v.condition_extension.as_deref(),
Self::RetrofittingCondition(v) => v.condition_extension.as_deref(),
Self::TariffCondition(v) => v.condition_extension.as_deref(),
Self::AccessCondition(v) => v.condition_extension.as_deref(),
Self::ConditionReference(v) => v.condition_extension.as_deref(),
Self::ConditionSet(v) => v.condition_extension.as_deref(),
Self::DriverCondition(v) => v.condition_extension.as_deref(),
Self::LocationCondition(v) => v.condition_extension.as_deref(),
Self::NonVehicularRoadUserCondition(v) => v.condition_extension.as_deref(),
Self::OccupantCondition(v) => v.condition_extension.as_deref(),
Self::RequiredPermitCondition(v) => v.condition_extension.as_deref(),
Self::RoadCondition(v) => v.condition_extension.as_deref(),
Self::StandingOrParkingCondition(v) => v.condition_extension.as_deref(),
Self::TimeValidityCondition(v) => v.condition_extension.as_deref(),
Self::TunnelCategoryCondition(v) => v.condition_extension.as_deref(),
Self::VehicleCondition(v) => v.condition_extension.as_deref(),
Self::WeatherCondition(v) => v.condition_extension.as_deref(),
}
}
}
impl Condition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::NonCodableCondition(v) => v.write(w, tag, " xsi:type=\"cz:NonCodableCondition\"", ""),
Self::PeriodCondition(v) => v.write(w, tag, " xsi:type=\"cz:PeriodCondition\"", ""),
Self::RetrofittingCondition(v) => v.write(w, tag, " xsi:type=\"cz:RetrofittingCondition\"", ""),
Self::TariffCondition(v) => v.write(w, tag, " xsi:type=\"cz:TariffCondition\"", ""),
Self::AccessCondition(v) => v.write(w, tag, " xsi:type=\"tro:AccessCondition\"", ""),
Self::ConditionReference(v) => v.write(w, tag, " xsi:type=\"tro:ConditionReference\"", ""),
Self::ConditionSet(v) => v.write(w, tag, " xsi:type=\"tro:ConditionSet\"", ""),
Self::DriverCondition(v) => v.write(w, tag, " xsi:type=\"tro:DriverCondition\"", ""),
Self::LocationCondition(v) => v.write(w, tag, " xsi:type=\"tro:LocationCondition\"", ""),
Self::NonVehicularRoadUserCondition(v) => v.write(w, tag, " xsi:type=\"tro:NonVehicularRoadUserCondition\"", ""),
Self::OccupantCondition(v) => v.write(w, tag, " xsi:type=\"tro:OccupantCondition\"", ""),
Self::RequiredPermitCondition(v) => v.write(w, tag, " xsi:type=\"tro:RequiredPermitCondition\"", ""),
Self::RoadCondition(v) => v.write(w, tag, " xsi:type=\"tro:RoadCondition\"", ""),
Self::StandingOrParkingCondition(v) => v.write(w, tag, " xsi:type=\"tro:StandingOrParkingCondition\"", ""),
Self::TimeValidityCondition(v) => v.write(w, tag, " xsi:type=\"tro:TimeValidityCondition\"", ""),
Self::TunnelCategoryCondition(v) => v.write(w, tag, " xsi:type=\"tro:TunnelCategoryCondition\"", ""),
Self::VehicleCondition(v) => v.write(w, tag, " xsi:type=\"tro:VehicleCondition\"", ""),
Self::WeatherCondition(v) => v.write(w, tag, " xsi:type=\"tro:WeatherCondition\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum DynamicTrafficRegulation {
DynamicTrafficManagement(Box<DynamicTrafficManagement>),
}
impl DynamicTrafficRegulation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x11008c) => Self::DynamicTrafficManagement(Box::new(DynamicTrafficManagement::read(r)?)),
_ => {
r.unknown_type("DynamicTrafficRegulation")?;
return Ok(None);
}
}))
}
pub fn issuing_authority(&self) -> Option<&MultilingualString> {
match self {
Self::DynamicTrafficManagement(v) => v.issuing_authority.as_ref(),
}
}
pub fn dynamic_traffic_regulation_extension(&self) -> Option<&Extension> {
match self {
Self::DynamicTrafficManagement(v) => v.dynamic_traffic_regulation_extension.as_deref(),
}
}
}
impl DynamicTrafficRegulation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::DynamicTrafficManagement(v) => v.write(w, tag, " xsi:type=\"tro:DynamicTrafficManagement\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum RoadSign {
MainSign(Box<MainSign>),
SupplementaryPanel(Box<SupplementaryPanel>),
}
impl RoadSign {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x1100fb) => Self::MainSign(Box::new(MainSign::read(r)?)),
Some(0x110201) => Self::SupplementaryPanel(Box::new(SupplementaryPanel::read(r)?)),
_ => {
r.unknown_type("RoadSign")?;
return Ok(None);
}
}))
}
pub fn picture_of_road_sign(&self) -> Option<&com::Base64Binary> {
match self {
Self::MainSign(v) => v.picture_of_road_sign.as_ref(),
Self::SupplementaryPanel(v) => v.picture_of_road_sign.as_ref(),
}
}
pub fn url_to_road_sign(&self) -> Option<&str> {
match self {
Self::MainSign(v) => v.url_to_road_sign.as_deref(),
Self::SupplementaryPanel(v) => v.url_to_road_sign.as_deref(),
}
}
pub fn national_sign_id(&self) -> Option<&str> {
match self {
Self::MainSign(v) => v.national_sign_id.as_deref(),
Self::SupplementaryPanel(v) => v.national_sign_id.as_deref(),
}
}
pub fn description(&self) -> Option<&MultilingualString> {
match self {
Self::MainSign(v) => v.description.as_ref(),
Self::SupplementaryPanel(v) => v.description.as_ref(),
}
}
pub fn gdd_pictogram_identification(&self) -> Option<&GddPictogramIdentification> {
match self {
Self::MainSign(v) => v.gdd_pictogram_identification.as_deref(),
Self::SupplementaryPanel(v) => v.gdd_pictogram_identification.as_deref(),
}
}
pub fn location_of_sign(&self) -> &[loc::AnyPointLocation] {
match self {
Self::MainSign(v) => &v.location_of_sign,
Self::SupplementaryPanel(v) => &v.location_of_sign,
}
}
pub fn road_sign_extension(&self) -> Option<&Extension> {
match self {
Self::MainSign(v) => v.road_sign_extension.as_deref(),
Self::SupplementaryPanel(v) => v.road_sign_extension.as_deref(),
}
}
}
impl RoadSign {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::MainSign(v) => v.write(w, tag, " xsi:type=\"tro:MainSign\"", ""),
Self::SupplementaryPanel(v) => v.write(w, tag, " xsi:type=\"tro:SupplementaryPanel\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum SpeedLimit {
AdvisorySpeed(Box<AdvisorySpeed>),
CompulsoryMinSpeed(Box<CompulsoryMinSpeed>),
MaxSpeedLimit(Box<MaxSpeedLimit>),
WalkingSpeed(Box<WalkingSpeed>),
}
impl SpeedLimit {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x110018) => Self::AdvisorySpeed(Box::new(AdvisorySpeed::read(r)?)),
Some(0x110055) => Self::CompulsoryMinSpeed(Box::new(CompulsoryMinSpeed::read(r)?)),
Some(0x110101) => Self::MaxSpeedLimit(Box::new(MaxSpeedLimit::read(r)?)),
Some(0x110279) => Self::WalkingSpeed(Box::new(WalkingSpeed::read(r)?)),
_ => {
r.unknown_type("SpeedLimit")?;
return Ok(None);
}
}))
}
pub fn type_of_regulation_extension(&self) -> Option<&Extension> {
match self {
Self::AdvisorySpeed(v) => v.type_of_regulation_extension.as_deref(),
Self::CompulsoryMinSpeed(v) => v.type_of_regulation_extension.as_deref(),
Self::MaxSpeedLimit(v) => v.type_of_regulation_extension.as_deref(),
Self::WalkingSpeed(v) => v.type_of_regulation_extension.as_deref(),
}
}
pub fn speed_limit_extension(&self) -> Option<&Extension> {
match self {
Self::AdvisorySpeed(v) => v.speed_limit_extension.as_deref(),
Self::CompulsoryMinSpeed(v) => v.speed_limit_extension.as_deref(),
Self::MaxSpeedLimit(v) => v.speed_limit_extension.as_deref(),
Self::WalkingSpeed(v) => v.speed_limit_extension.as_deref(),
}
}
}
impl SpeedLimit {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AdvisorySpeed(v) => v.write(w, tag, " xsi:type=\"tro:AdvisorySpeed\"", ""),
Self::CompulsoryMinSpeed(v) => v.write(w, tag, " xsi:type=\"tro:CompulsoryMinSpeed\"", ""),
Self::MaxSpeedLimit(v) => v.write(w, tag, " xsi:type=\"tro:MaxSpeedLimit\"", ""),
Self::WalkingSpeed(v) => v.write(w, tag, " xsi:type=\"tro:WalkingSpeed\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyTrafficRegulation {
TrafficRegulation(Box<TrafficRegulation>),
ControlledZoneRegulation(Box<cz::ControlledZoneRegulation>),
}
impl AnyTrafficRegulation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x110238) => Self::TrafficRegulation(Box::new(TrafficRegulation::read(r)?)),
Some(0x50060) => Self::ControlledZoneRegulation(Box::new(cz::ControlledZoneRegulation::read(r)?)),
None => Self::TrafficRegulation(Box::new(TrafficRegulation::read(r)?)),
_ => {
r.unknown_type_as("TrafficRegulation");
Self::TrafficRegulation(Box::new(TrafficRegulation::read(r)?))
}
}))
}
pub fn id(&self) -> Option<&str> {
match self {
Self::TrafficRegulation(v) => v.id.as_deref(),
Self::ControlledZoneRegulation(v) => v.id.as_deref(),
}
}
pub fn version(&self) -> Option<&str> {
match self {
Self::TrafficRegulation(v) => v.version.as_deref(),
Self::ControlledZoneRegulation(v) => v.version.as_deref(),
}
}
pub fn status(&self) -> Option<&ActivationStatusEnum> {
match self {
Self::TrafficRegulation(v) => v.status.as_ref(),
Self::ControlledZoneRegulation(v) => v.status.as_ref(),
}
}
pub fn road_sign(&self) -> &[RoadSign] {
match self {
Self::TrafficRegulation(v) => &v.road_sign,
Self::ControlledZoneRegulation(v) => &v.road_sign,
}
}
pub fn type_of_regulation(&self) -> &[TypeOfRegulation] {
match self {
Self::TrafficRegulation(v) => &v.type_of_regulation,
Self::ControlledZoneRegulation(v) => &v.type_of_regulation,
}
}
pub fn condition(&self) -> Option<&Condition> {
match self {
Self::TrafficRegulation(v) => v.condition.as_ref(),
Self::ControlledZoneRegulation(v) => v.condition.as_ref(),
}
}
pub fn permit_information(&self) -> &[PermitInformation] {
match self {
Self::TrafficRegulation(v) => &v.permit_information,
Self::ControlledZoneRegulation(v) => &v.permit_information,
}
}
pub fn traffic_regulation_extension(&self) -> Option<&Extension> {
match self {
Self::TrafficRegulation(v) => v.traffic_regulation_extension.as_deref(),
Self::ControlledZoneRegulation(v) => v.traffic_regulation_extension.as_deref(),
}
}
}
impl AnyTrafficRegulation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::TrafficRegulation(v) => v.write(w, tag, "", ""),
Self::ControlledZoneRegulation(v) => v.write(w, tag, " xsi:type=\"cz:ControlledZoneRegulation\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyTrafficRegulationOrder {
TrafficRegulationOrder(Box<TrafficRegulationOrder>),
TemporaryTrafficRegulationOrder(Box<TemporaryTrafficRegulationOrder>),
}
impl AnyTrafficRegulationOrder {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x11023a) => Self::TrafficRegulationOrder(Box::new(TrafficRegulationOrder::read(r)?)),
Some(0x11020e) => Self::TemporaryTrafficRegulationOrder(Box::new(TemporaryTrafficRegulationOrder::read(r)?)),
None => Self::TrafficRegulationOrder(Box::new(TrafficRegulationOrder::read(r)?)),
_ => {
r.unknown_type_as("TrafficRegulationOrder");
Self::TrafficRegulationOrder(Box::new(TrafficRegulationOrder::read(r)?))
}
}))
}
pub fn id(&self) -> Option<&str> {
match self {
Self::TrafficRegulationOrder(v) => v.id.as_deref(),
Self::TemporaryTrafficRegulationOrder(v) => v.id.as_deref(),
}
}
pub fn version(&self) -> Option<&str> {
match self {
Self::TrafficRegulationOrder(v) => v.version.as_deref(),
Self::TemporaryTrafficRegulationOrder(v) => v.version.as_deref(),
}
}
pub fn description(&self) -> Option<&MultilingualString> {
match self {
Self::TrafficRegulationOrder(v) => v.description.as_ref(),
Self::TemporaryTrafficRegulationOrder(v) => v.description.as_ref(),
}
}
pub fn issuing_authority(&self) -> Option<&MultilingualString> {
match self {
Self::TrafficRegulationOrder(v) => v.issuing_authority.as_ref(),
Self::TemporaryTrafficRegulationOrder(v) => v.issuing_authority.as_ref(),
}
}
pub fn reason(&self) -> &[ReasonForRegulationEnum] {
match self {
Self::TrafficRegulationOrder(v) => &v.reason,
Self::TemporaryTrafficRegulationOrder(v) => &v.reason,
}
}
pub fn regulation_id(&self) -> Option<&str> {
match self {
Self::TrafficRegulationOrder(v) => v.regulation_id.as_deref(),
Self::TemporaryTrafficRegulationOrder(v) => v.regulation_id.as_deref(),
}
}
pub fn status(&self) -> Option<&TrafficRegulationOrderStatusEnum> {
match self {
Self::TrafficRegulationOrder(v) => v.status.as_ref(),
Self::TemporaryTrafficRegulationOrder(v) => v.status.as_ref(),
}
}
pub fn implemented_validity(&self) -> Option<&com::Validity> {
match self {
Self::TrafficRegulationOrder(v) => v.implemented_validity.as_deref(),
Self::TemporaryTrafficRegulationOrder(v) => v.implemented_validity.as_deref(),
}
}
pub fn validity_by_order(&self) -> Option<&com::Validity> {
match self {
Self::TrafficRegulationOrder(v) => v.validity_by_order.as_deref(),
Self::TemporaryTrafficRegulationOrder(v) => v.validity_by_order.as_deref(),
}
}
pub fn implemented_location(&self) -> Option<&loc::LocationReference> {
match self {
Self::TrafficRegulationOrder(v) => v.implemented_location.as_ref(),
Self::TemporaryTrafficRegulationOrder(v) => v.implemented_location.as_ref(),
}
}
pub fn location_by_order(&self) -> Option<&loc::LocationReference> {
match self {
Self::TrafficRegulationOrder(v) => v.location_by_order.as_ref(),
Self::TemporaryTrafficRegulationOrder(v) => v.location_by_order.as_ref(),
}
}
pub fn traffic_regulation(&self) -> &[AnyTrafficRegulation] {
match self {
Self::TrafficRegulationOrder(v) => &v.traffic_regulation,
Self::TemporaryTrafficRegulationOrder(v) => &v.traffic_regulation,
}
}
pub fn legal_basis(&self) -> Option<&LegalBasis> {
match self {
Self::TrafficRegulationOrder(v) => v.legal_basis.as_deref(),
Self::TemporaryTrafficRegulationOrder(v) => v.legal_basis.as_deref(),
}
}
pub fn traffic_regulation_order_extension(&self) -> Option<&Extension> {
match self {
Self::TrafficRegulationOrder(v) => v.traffic_regulation_order_extension.as_deref(),
Self::TemporaryTrafficRegulationOrder(v) => v.traffic_regulation_order_extension.as_deref(),
}
}
}
impl AnyTrafficRegulationOrder {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::TrafficRegulationOrder(v) => v.write(w, tag, "", ""),
Self::TemporaryTrafficRegulationOrder(v) => v.write(w, tag, " xsi:type=\"tro:TemporaryTrafficRegulationOrder\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum TypeOfRegulation {
AccessRestriction(Box<AccessRestriction>),
AlternateRoadOrCarriagewayOrLaneLayout(Box<AlternateRoadOrCarriagewayOrLaneLayout>),
DirectionRestriction(Box<DirectionRestriction>),
HardShoulderRunningRestriction(Box<HardShoulderRunningRestriction>),
MandatoryRoadOrCarriagewayOrLaneUsage(Box<MandatoryRoadOrCarriagewayOrLaneUsage>),
MinimumDistanceRestriction(Box<MinimumDistanceRestriction>),
PriorityRule(Box<PriorityRule>),
ProhibitionOfOvertaking(Box<ProhibitionOfOvertaking>),
Rerouting(Box<Rerouting>),
RushHourLaneRestriction(Box<RushHourLaneRestriction>),
AdvisorySpeed(Box<AdvisorySpeed>),
CompulsoryMinSpeed(Box<CompulsoryMinSpeed>),
MaxSpeedLimit(Box<MaxSpeedLimit>),
WalkingSpeed(Box<WalkingSpeed>),
StandingOrParkingControl(Box<StandingOrParkingControl>),
AmbientWarning(Box<AmbientWarning>),
RoadWarning(Box<RoadWarning>),
SteepHill(Box<SteepHill>),
TrafficAhead(Box<TrafficAhead>),
}
impl TypeOfRegulation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x110006) => Self::AccessRestriction(Box::new(AccessRestriction::read(r)?)),
Some(0x11002a) => Self::AlternateRoadOrCarriagewayOrLaneLayout(Box::new(AlternateRoadOrCarriagewayOrLaneLayout::read(r)?)),
Some(0x110080) => Self::DirectionRestriction(Box::new(DirectionRestriction::read(r)?)),
Some(0x1100ce) => Self::HardShoulderRunningRestriction(Box::new(HardShoulderRunningRestriction::read(r)?)),
Some(0x1100ff) => Self::MandatoryRoadOrCarriagewayOrLaneUsage(Box::new(MandatoryRoadOrCarriagewayOrLaneUsage::read(r)?)),
Some(0x11010e) => Self::MinimumDistanceRestriction(Box::new(MinimumDistanceRestriction::read(r)?)),
Some(0x110198) => Self::PriorityRule(Box::new(PriorityRule::read(r)?)),
Some(0x110199) => Self::ProhibitionOfOvertaking(Box::new(ProhibitionOfOvertaking::read(r)?)),
Some(0x1101b8) => Self::Rerouting(Box::new(Rerouting::read(r)?)),
Some(0x1101d1) => Self::RushHourLaneRestriction(Box::new(RushHourLaneRestriction::read(r)?)),
Some(0x110018) => Self::AdvisorySpeed(Box::new(AdvisorySpeed::read(r)?)),
Some(0x110055) => Self::CompulsoryMinSpeed(Box::new(CompulsoryMinSpeed::read(r)?)),
Some(0x110101) => Self::MaxSpeedLimit(Box::new(MaxSpeedLimit::read(r)?)),
Some(0x110279) => Self::WalkingSpeed(Box::new(WalkingSpeed::read(r)?)),
Some(0x1101ee) => Self::StandingOrParkingControl(Box::new(StandingOrParkingControl::read(r)?)),
Some(0x11002e) => Self::AmbientWarning(Box::new(AmbientWarning::read(r)?)),
Some(0x1101cb) => Self::RoadWarning(Box::new(RoadWarning::read(r)?)),
Some(0x1101f4) => Self::SteepHill(Box::new(SteepHill::read(r)?)),
Some(0x110230) => Self::TrafficAhead(Box::new(TrafficAhead::read(r)?)),
_ => {
r.unknown_type("TypeOfRegulation")?;
return Ok(None);
}
}))
}
pub fn type_of_regulation_extension(&self) -> Option<&Extension> {
match self {
Self::AccessRestriction(v) => v.type_of_regulation_extension.as_deref(),
Self::AlternateRoadOrCarriagewayOrLaneLayout(v) => v.type_of_regulation_extension.as_deref(),
Self::DirectionRestriction(v) => v.type_of_regulation_extension.as_deref(),
Self::HardShoulderRunningRestriction(v) => v.type_of_regulation_extension.as_deref(),
Self::MandatoryRoadOrCarriagewayOrLaneUsage(v) => v.type_of_regulation_extension.as_deref(),
Self::MinimumDistanceRestriction(v) => v.type_of_regulation_extension.as_deref(),
Self::PriorityRule(v) => v.type_of_regulation_extension.as_deref(),
Self::ProhibitionOfOvertaking(v) => v.type_of_regulation_extension.as_deref(),
Self::Rerouting(v) => v.type_of_regulation_extension.as_deref(),
Self::RushHourLaneRestriction(v) => v.type_of_regulation_extension.as_deref(),
Self::AdvisorySpeed(v) => v.type_of_regulation_extension.as_deref(),
Self::CompulsoryMinSpeed(v) => v.type_of_regulation_extension.as_deref(),
Self::MaxSpeedLimit(v) => v.type_of_regulation_extension.as_deref(),
Self::WalkingSpeed(v) => v.type_of_regulation_extension.as_deref(),
Self::StandingOrParkingControl(v) => v.type_of_regulation_extension.as_deref(),
Self::AmbientWarning(v) => v.type_of_regulation_extension.as_deref(),
Self::RoadWarning(v) => v.type_of_regulation_extension.as_deref(),
Self::SteepHill(v) => v.type_of_regulation_extension.as_deref(),
Self::TrafficAhead(v) => v.type_of_regulation_extension.as_deref(),
}
}
}
impl TypeOfRegulation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AccessRestriction(v) => v.write(w, tag, " xsi:type=\"tro:AccessRestriction\"", ""),
Self::AlternateRoadOrCarriagewayOrLaneLayout(v) => v.write(w, tag, " xsi:type=\"tro:AlternateRoadOrCarriagewayOrLaneLayout\"", ""),
Self::DirectionRestriction(v) => v.write(w, tag, " xsi:type=\"tro:DirectionRestriction\"", ""),
Self::HardShoulderRunningRestriction(v) => v.write(w, tag, " xsi:type=\"tro:HardShoulderRunningRestriction\"", ""),
Self::MandatoryRoadOrCarriagewayOrLaneUsage(v) => v.write(w, tag, " xsi:type=\"tro:MandatoryRoadOrCarriagewayOrLaneUsage\"", ""),
Self::MinimumDistanceRestriction(v) => v.write(w, tag, " xsi:type=\"tro:MinimumDistanceRestriction\"", ""),
Self::PriorityRule(v) => v.write(w, tag, " xsi:type=\"tro:PriorityRule\"", ""),
Self::ProhibitionOfOvertaking(v) => v.write(w, tag, " xsi:type=\"tro:ProhibitionOfOvertaking\"", ""),
Self::Rerouting(v) => v.write(w, tag, " xsi:type=\"tro:Rerouting\"", ""),
Self::RushHourLaneRestriction(v) => v.write(w, tag, " xsi:type=\"tro:RushHourLaneRestriction\"", ""),
Self::AdvisorySpeed(v) => v.write(w, tag, " xsi:type=\"tro:AdvisorySpeed\"", ""),
Self::CompulsoryMinSpeed(v) => v.write(w, tag, " xsi:type=\"tro:CompulsoryMinSpeed\"", ""),
Self::MaxSpeedLimit(v) => v.write(w, tag, " xsi:type=\"tro:MaxSpeedLimit\"", ""),
Self::WalkingSpeed(v) => v.write(w, tag, " xsi:type=\"tro:WalkingSpeed\"", ""),
Self::StandingOrParkingControl(v) => v.write(w, tag, " xsi:type=\"tro:StandingOrParkingControl\"", ""),
Self::AmbientWarning(v) => v.write(w, tag, " xsi:type=\"tro:AmbientWarning\"", ""),
Self::RoadWarning(v) => v.write(w, tag, " xsi:type=\"tro:RoadWarning\"", ""),
Self::SteepHill(v) => v.write(w, tag, " xsi:type=\"tro:SteepHill\"", ""),
Self::TrafficAhead(v) => v.write(w, tag, " xsi:type=\"tro:TrafficAhead\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Warning {
AmbientWarning(Box<AmbientWarning>),
RoadWarning(Box<RoadWarning>),
SteepHill(Box<SteepHill>),
TrafficAhead(Box<TrafficAhead>),
}
impl Warning {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x11002e) => Self::AmbientWarning(Box::new(AmbientWarning::read(r)?)),
Some(0x1101cb) => Self::RoadWarning(Box::new(RoadWarning::read(r)?)),
Some(0x1101f4) => Self::SteepHill(Box::new(SteepHill::read(r)?)),
Some(0x110230) => Self::TrafficAhead(Box::new(TrafficAhead::read(r)?)),
_ => {
r.unknown_type("Warning")?;
return Ok(None);
}
}))
}
pub fn type_of_regulation_extension(&self) -> Option<&Extension> {
match self {
Self::AmbientWarning(v) => v.type_of_regulation_extension.as_deref(),
Self::RoadWarning(v) => v.type_of_regulation_extension.as_deref(),
Self::SteepHill(v) => v.type_of_regulation_extension.as_deref(),
Self::TrafficAhead(v) => v.type_of_regulation_extension.as_deref(),
}
}
pub fn warning_extension(&self) -> Option<&Extension> {
match self {
Self::AmbientWarning(v) => v.warning_extension.as_deref(),
Self::RoadWarning(v) => v.warning_extension.as_deref(),
Self::SteepHill(v) => v.warning_extension.as_deref(),
Self::TrafficAhead(v) => v.warning_extension.as_deref(),
}
}
}
impl Warning {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AmbientWarning(v) => v.write(w, tag, " xsi:type=\"tro:AmbientWarning\"", ""),
Self::RoadWarning(v) => v.write(w, tag, " xsi:type=\"tro:RoadWarning\"", ""),
Self::SteepHill(v) => v.write(w, tag, " xsi:type=\"tro:SteepHill\"", ""),
Self::TrafficAhead(v) => v.write(w, tag, " xsi:type=\"tro:TrafficAhead\"", ""),
}
}
}