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§
sourcefn get_arrival<'a>(
client: &C,
bus_stop_code: u32,
service_no: impl Into<Option<&'a str>>
) -> LTAResult<BusArrivalResp>
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§
sourcefn get_bus_services(
client: &C,
skip: impl Into<Option<u32>>
) -> LTAResult<Vec<BusService>>
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
Object Safety§
This trait is not object safe.