pub trait TrafficRequests<C: Client + ClientExt> {
    // Required method
    fn get_bike_parking(
        client: &C,
        lat: f64,
        long: f64,
        dist: impl Into<Option<f64>>
    ) -> LTAResult<Vec<BikeParking>>;

    // Provided methods
    fn get_erp_rates(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<ErpRate>> { ... }
    fn get_carpark_avail(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<CarPark>> { ... }
    fn get_est_travel_time(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<EstTravelTime>> { ... }
    fn get_faulty_traffic_lights(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<FaultyTrafficLight>> { ... }
    fn get_road_details(
        client: &C,
        road_details_type: RoadDetailsType,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<RoadDetails>> { ... }
    fn get_traffic_speed_band(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<TrafficSpeedBand>> { ... }
    fn get_traffic_images(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<TrafficImage>> { ... }
    fn get_traffic_incidents(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<TrafficIncident>> { ... }
    fn get_vms_emas(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<Vms>> { ... }
    fn get_traffic_flow(client: &C) -> LTAResult<Vec<String>> { ... }
}

Required Methods§

source

fn get_bike_parking( client: &C, lat: f64, long: f64, dist: impl Into<Option<f64>> ) -> LTAResult<Vec<BikeParking>>

Returns bicycle parking locations within a radius

Dist is default to 0.5 even if you provide None

Update freq: Monthly

Provided Methods§

source

fn get_erp_rates( client: &C, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<ErpRate>>

Returns ERP rates of all vehicle types across all timings for each zone.

Update freq: Ad-Hoc

source

fn get_carpark_avail( client: &C, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<CarPark>>

Returns no. of available lots for HDB, LTA and URA carpark data. The LTA carpark data consist of major shopping malls and developments within Orchard, Marina, HarbourFront, Jurong Lake District. (Note: list of LTA carpark data available on this API is subset of those listed on One.Motoring and MyTransport Portals)

Update freq: 1 min

source

fn get_est_travel_time( client: &C, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<EstTravelTime>>

Returns estimated travel times of expressways (in segments).

Update freq: 5min

source

fn get_faulty_traffic_lights( client: &C, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<FaultyTrafficLight>>

Returns alerts of traffic lights that are currently faulty, or currently undergoing scheduled maintenance.

Update freq: 2min or whenever there are updates

source

fn get_road_details( client: &C, road_details_type: RoadDetailsType, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<RoadDetails>>

Returns all planned road openings or road works depending on the RoadDetailsType supplied

Update freq: 24 hours – whenever there are updates

source

fn get_traffic_speed_band( client: &C, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<TrafficSpeedBand>>

Returns current traffic speeds on expressways and arterial roads, expressed in speed bands.

Update freq: 5 minutes

source

fn get_traffic_images( client: &C, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<TrafficImage>>

Returns links to images of live traffic conditions along expressways and Woodlands & Tuas Checkpoints.

Update freq: 1 to 5 minutes

source

fn get_traffic_incidents( client: &C, skip: impl Into<Option<u32>> ) -> LTAResult<Vec<TrafficIncident>>

Returns current traffic speeds on expressways and arterial roads, expressed in speed bands.

Update freq: 5 minutes

source

fn get_vms_emas(client: &C, skip: impl Into<Option<u32>>) -> LTAResult<Vec<Vms>>

Returns traffic advisories (via variable message services) concerning current traffic conditions that are displayed on EMAS signboards along expressways and arterial roads.

Update freq: 2 minutes

source

fn get_traffic_flow(client: &C) -> LTAResult<Vec<String>>

Returns hourly average traffic flow, taken from a representative month of every quarter during 0700-0900 hours.

Update freq: Quaterly

Object Safety§

This trait is not object safe.

Implementors§