diff --git a/src/bus.rs b/src/bus.rs index 6b5038b..955e25d 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -19,9 +19,6 @@ pub mod bus_arrival { #[cfg(feature = "fastfloat")] use crate::utils::de::from_str_fast_float; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusArrivalv2"; - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] pub struct RawArrivalBusService { @@ -162,9 +159,6 @@ pub mod bus_services { use crate::utils::regex::BUS_FREQ_RE; use serde::{Deserialize, Deserializer, Serialize}; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusServices"; - /// Both min and max are in terms of minutes #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct BusFreq { @@ -307,9 +301,6 @@ pub mod bus_routes { use crate::utils::de::from_str; use crate::utils::serde_date::str_time_option::{de_str_time_opt_br, ser_str_time_opt}; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusRoutes"; - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] pub struct BusRouteRaw { @@ -423,9 +414,6 @@ pub mod bus_stops { use crate::utils::de::from_str; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BusStops"; - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] pub struct BusStopRaw { diff --git a/src/bus_enums.rs b/src/bus_enums.rs index e9c6993..e6f8eed 100644 --- a/src/bus_enums.rs +++ b/src/bus_enums.rs @@ -14,7 +14,7 @@ use serde::{Deserialize, Serialize}; /// TTS -> Tower Transit Singapore /// /// GAS -> Go Ahead Singapore -#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, Default)] pub enum Operator { #[serde(rename = "SBST")] Sbst, @@ -28,6 +28,7 @@ pub enum Operator { #[serde(rename = "GAS")] Gas, + #[default] #[serde(other)] Unknown, } diff --git a/src/crowd.rs b/src/crowd.rs index 5a114ce..647945e 100644 --- a/src/crowd.rs +++ b/src/crowd.rs @@ -16,15 +16,7 @@ pub mod crowd_density { OffsetDateTime, }; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_CROWD_DENSITY_RT: &str = - "http://datamall2.mytransport.sg/ltaodataservice/PCDRealTime"; - - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_CROWD_FORECAST: &str = - "http://datamall2.mytransport.sg/ltaodataservice/PCDForecast"; - - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] pub enum CrowdLevel { #[serde(rename = "l")] Low, @@ -35,6 +27,7 @@ pub mod crowd_density { #[serde(rename = "m")] Moderate, + #[default] #[serde(other)] Na, } @@ -142,22 +135,9 @@ pub mod crowd_density { pub mod passenger_vol { use serde::{Deserialize, Serialize}; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_BY_BUS_STOPS: &str = "http://datamall2.mytransport.sg/ltaodataservice/PV/Bus"; - - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_BY_OD_BUS_STOPS: &str = - "http://datamall2.mytransport.sg/ltaodataservice/PV/ODBus"; - - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_BY_TRAIN: &str = "http://datamall2.mytransport.sg/ltaodataservice/PV/Train"; - - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_BY_OD_TRAIN: &str = "http://datamall2.mytransport.sg/ltaodataservice/PV/ODTrain"; - pub const FORMAT: &str = "%Y%m"; - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] pub enum VolType { /// Returns tap in and tap out passenger volume by weekdays and /// weekends for individual bus stop @@ -175,6 +155,7 @@ pub mod passenger_vol { /// weekends for individual train station OdTrain, + #[default] #[serde(other)] Unknown, } diff --git a/src/geo.rs b/src/geo.rs index de8c924..5bac874 100644 --- a/src/geo.rs +++ b/src/geo.rs @@ -5,6 +5,8 @@ pub mod prelude { } pub mod geospatial_whole_island { + use std::default; + use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] @@ -18,7 +20,7 @@ pub mod geospatial_whole_island { pub link: String, } - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum GeospatialLayerId { ArrowMarking, Bollard, @@ -59,6 +61,10 @@ pub mod geospatial_whole_island { #[serde(alias = "VehicularBridge_Flyover_Underpass")] VehicularBridgeOrFlyoverOrUnderpass, WordMarking, + + #[default] + #[serde(other)] + Unknown } impl From for Vec { diff --git a/src/taxi.rs b/src/taxi.rs index 6273d09..13610d1 100644 --- a/src/taxi.rs +++ b/src/taxi.rs @@ -14,9 +14,6 @@ pub mod taxi_avail { use crate::utils::Coordinates; use serde::{Deserialize, Serialize}; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/Taxi-Availability"; - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct InternalCoordinates { /// Original data already float @@ -53,10 +50,7 @@ pub mod taxi_stands { use crate::utils::de::from_str_to_bool; use serde::{Deserialize, Serialize}; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/TaxiStands"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum TaxiStandOwner { #[serde(rename = "LTA")] Lta, @@ -66,11 +60,12 @@ pub mod taxi_stands { Private, + #[default] #[serde(other)] Unknown, } - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum TaxiStandType { /// Allow taxis to queue in the taxi bays and wait for passengers Stand, @@ -78,6 +73,7 @@ pub mod taxi_stands { /// Allow taxis to perform immediate pick up and drop off of passengers Stop, + #[default] #[serde(other)] Unknown, } diff --git a/src/traffic.rs b/src/traffic.rs index 464a9f1..025a285 100644 --- a/src/traffic.rs +++ b/src/traffic.rs @@ -37,10 +37,7 @@ pub mod erp_rates { }, }; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/ERPRates"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum VehicleType { #[serde(alias = "Passenger Cars")] PassengerCars, @@ -63,6 +60,7 @@ pub mod erp_rates { #[serde(alias = "Big Buses")] BigBuses, + #[default] #[serde(other)] Unknown, } @@ -95,14 +93,18 @@ pub mod erp_rates { } } - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum DayType { Weekdays, Saturday, + + #[default] + #[serde(other)] + Unknown } #[allow(clippy::upper_case_acronyms)] - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum ZoneId { CT2, PE4, @@ -138,6 +140,7 @@ pub mod erp_rates { MC1, MC2, + #[default] #[serde(other)] Unknown, } @@ -222,25 +225,25 @@ pub mod carpark_avail { use crate::utils::de::from_str_to_coords; use crate::utils::Coordinates; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/CarParkAvailabilityv2"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum LotType { C, L, Y, H, + + #[default] #[serde(other)] Unknown, } - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] #[allow(clippy::upper_case_acronyms)] pub enum Agency { HDB, URA, LTA, + #[default] #[serde(other)] Unknown, } @@ -309,11 +312,8 @@ pub mod est_travel_time { use serde::{Deserialize, Serialize}; use serde_repr::*; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/EstTravelTimes"; - #[allow(clippy::upper_case_acronyms)] - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum Highway { PIE, AYE, @@ -326,15 +326,18 @@ pub mod est_travel_time { BKE, KJE, MCE, + + #[default] #[serde(other)] Unknown, } - #[derive(Debug, Clone, PartialEq, Serialize_repr, Deserialize_repr)] + #[derive(Debug, Clone, PartialEq, Serialize_repr, Deserialize_repr, Default)] #[repr(u32)] pub enum HighwayDirection { EastToWest = 1, WestToEast = 2, + #[default] #[serde(other)] Unknown, } @@ -400,13 +403,11 @@ pub mod faulty_traffic_lights { use crate::utils::serde_date::ymd_hms_option; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/FaultyTrafficLights"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum TechnicalAlarmType { Blackout = 4, FlashingYellow = 13, + #[default] #[serde(other)] Unknown, } @@ -450,17 +451,11 @@ pub mod road { use crate::utils::serde_date::str_date; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_ROAD_OPENING: &str = - "http://datamall2.mytransport.sg/ltaodataservice/RoadOpenings"; - - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL_ROAD_WORKS: &str = "http://datamall2.mytransport.sg/ltaodataservice/RoadWorks"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum RoadDetailsType { RoadOpening, RoadWorks, + #[default] #[serde(other)] Unknown, } @@ -502,9 +497,6 @@ pub mod traffic_images { use crate::utils::de::from_str; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/Traffic-Imagesv2"; - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct TrafficImageRaw { #[serde(alias = "CameraID", deserialize_with = "from_str")] @@ -555,10 +547,7 @@ pub mod traffic_images { pub mod traffic_incidents { use serde::{Deserialize, Serialize}; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/TrafficIncidents"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum IncidentType { Accident, @@ -588,6 +577,7 @@ pub mod traffic_incidents { Roadwork, + #[default] #[serde(other)] Unknown, } @@ -627,10 +617,7 @@ pub mod traffic_speed_bands { #[cfg(feature = "fastfloat")] use crate::utils::de::from_str_fast_float; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/TrafficSpeedBandsv2"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum RoadCategory { #[serde(alias = "A")] Expressway, @@ -653,6 +640,7 @@ pub mod traffic_speed_bands { #[serde(alias = "G")] NoCategoryInfoAvail, + #[default] #[serde(other)] Unknown, } @@ -739,9 +727,6 @@ pub mod traffic_speed_bands { pub mod vms_emas { use serde::{Deserialize, Serialize}; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/VMS"; - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct Vms { #[serde(alias = "EquipmentID")] @@ -774,10 +759,7 @@ pub mod bike_parking { use crate::utils::de::from_str_to_bool; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/BicycleParkingv2"; - - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum RackType { #[serde(alias = "Yellow Box")] YellowBox, @@ -818,6 +800,7 @@ pub mod bike_parking { #[serde(alias = "Racks_NEA")] RacksNEA, + #[default] #[serde(other)] Unknown, } diff --git a/src/train.rs b/src/train.rs index 94823b6..79d77c0 100644 --- a/src/train.rs +++ b/src/train.rs @@ -14,14 +14,14 @@ pub mod prelude { /// Some of the stations are commented out to prevent misuse as they are technically /// not constructed yet or it has not been announced #[allow(clippy::upper_case_acronyms)] -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum StationCode { NS1, NS2, NS3, NS4, NS5, - // NS6, + NS6, NS7, NS8, NS9, @@ -126,7 +126,7 @@ pub enum StationCode { CC27, CC28, CC29, - CC30, // keppel + CC30, // koppel CC31, // cantonment CC32, // prince edward road CC33, @@ -245,6 +245,8 @@ pub enum StationCode { PW5, PW6, PW7, + + #[default] #[serde(other)] Unknown, } @@ -257,11 +259,8 @@ pub mod train_service_alert { use std::ops::Deref; use std::str::FromStr; - #[deprecated(since = "0.5.0", note = "Will be removed in future versions")] - pub const URL: &str = "http://datamall2.mytransport.sg/ltaodataservice/TrainServiceAlerts"; - #[allow(clippy::upper_case_acronyms)] - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] + #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Default)] pub enum MrtLine { CCL, CEL, @@ -276,16 +275,18 @@ pub mod train_service_alert { SWL, BPL, + #[default] #[serde(other)] Unknown, } - #[derive(Debug, Clone, PartialEq, Serialize_repr, Deserialize_repr)] + #[derive(Debug, Clone, PartialEq, Serialize_repr, Deserialize_repr, Default)] #[repr(u32)] pub enum TrainStatus { Normal = 1, Disrupted = 2, + #[default] #[serde(other)] Unknown, }