[][src]Function lta::bus::get_bus_stops

pub fn get_bus_stops(client: &LTAClient) -> Result<Vec<BusStop>>

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

Update freq: Ad-Hoc

Example

use lta::prelude::*;
use lta::Result;
use lta::bus::get_bus_stops;
use lta::lta_client::LTAClient;

fn main() -> Result<()> {
    let api_key = std::env::var("API_KEY").unwrap();
    let client = LTAClient::with_api_key(api_key);
    let bus_stops: Vec<BusStop> = get_bus_stops(&client)?;
    println!("{:?}", bus_stops);
    Ok(())
}