use async_trait::async_trait;
use everymap_core::error::EveryMapResult;
#[async_trait]
pub trait GooglePositionerExt: Send + Sync {
async fn locate(
&self,
options: super::domain::positioning::GooglePositioningOptions,
) -> EveryMapResult<super::domain::positioning::GoogleGeolocationResponse>;
}
#[async_trait]
pub trait GoogleAttributeExt: Send + Sync {
async fn get_speed_limits_by_ids(
&self,
place_ids: &[String],
units: Option<&str>,
) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse>;
async fn get_speed_limits_along_path(
&self,
path: &str,
units: Option<&str>,
) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse>;
}
#[async_trait]
impl GooglePositionerExt for super::domain::positioning::GooglePositioner {
async fn locate(
&self,
options: super::domain::positioning::GooglePositioningOptions,
) -> EveryMapResult<super::domain::positioning::GoogleGeolocationResponse> {
self.locate(options).await
}
}
#[async_trait]
impl GoogleAttributeExt for super::domain::attributes::GoogleAttributeProvider {
async fn get_speed_limits_by_ids(
&self,
place_ids: &[String],
units: Option<&str>,
) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse> {
self.get_speed_limits_by_ids(place_ids, units).await
}
async fn get_speed_limits_along_path(
&self,
path: &str,
units: Option<&str>,
) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse> {
self.get_speed_limits_along_path(path, units).await
}
}