Trait lta::blocking::bus::BusRequests

source ·
pub trait BusRequests<C: Client + ClientExt> {
    // Required method
    fn get_arrival<'a>(
        client: &C,
        bus_stop_code: u32,
        service_no: impl Into<Option<&'a str>>
    ) -> LTAResult<BusArrivalResp>;

    // Provided methods
    fn get_bus_services(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<BusService>> { ... }
    fn get_bus_routes(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<BusRoute>> { ... }
    fn get_bus_stops(
        client: &C,
        skip: impl Into<Option<u32>>
    ) -> LTAResult<Vec<BusStop>> { ... }
}
Expand description

All API pertaining to buses

Required Methods§

source

fn get_arrival<'a>( client: &C, bus_stop_code: u32, service_no: impl Into<Option<&'a str>> ) -> LTAResult<BusArrivalResp>

Returns real-time Bus Arrival information of Bus Services at a queried Bus Stop, including

  • Estimated Arrival Time
  • Estimated Current Location
  • Estimated Current Load.

Sometimes, it may return an empty Vec

If that happens, it means that there are no services at that timing.

Update freq: 1min

Provided Methods§

source

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

Returns detailed service information for all buses currently in operation, including: first stop, last stop, peak / offpeak frequency of dispatch.

Update freq: Ad-Hoc

source

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

Returns detailed route information for all services currently in operation, including: all bus stops along each route, first/last bus timings for each stop

Update freq: Ad-Hoc

source

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

Returns detailed information for all bus stops currently being serviced by buses, including: Bus Stop Code, location coordinates.

Update freq: Ad-Hoc

Object Safety§

This trait is not object safe.

Implementors§