use crate::models::prelude::*;
use crate::models::utils::Coordinates;
use crate::r#async::build_req_with_skip;
use crate::r#async::LTAClient;
use crate::{api_url, Client, LTAResult, Taxi};
use async_trait::async_trait;
#[async_trait]
pub trait TaxiRequests<C: Client> {
async fn get_taxi_avail<S>(client: &C, skip: S) -> LTAResult<Vec<Coordinates>>
where
S: Into<Option<u32>> + Send;
async fn get_taxi_stands<S>(client: &C, skip: S) -> LTAResult<Vec<TaxiStand>>
where
S: Into<Option<u32>> + Send;
}
#[async_trait]
impl TaxiRequests<LTAClient> for Taxi {
async fn get_taxi_avail<S>(client: <AClient, skip: S) -> LTAResult<Vec<Coordinates>>
where
S: Into<Option<u32>> + Send,
{
build_req_with_skip::<TaxiAvailResp, _, _>(
client,
api_url!("/Taxi-Availability"),
skip.into(),
)
.await
}
async fn get_taxi_stands<S>(client: <AClient, skip: S) -> LTAResult<Vec<TaxiStand>>
where
S: Into<Option<u32>> + Send,
{
build_req_with_skip::<TaxiStandsResp, _, _>(client, api_url!("/TaxiStands"), skip.into())
.await
}
}