everymap_providers_google/
ext.rs1use async_trait::async_trait;
2use everymap_core::error::EveryMapResult;
3
4#[async_trait]
14pub trait GooglePositionerExt: Send + Sync {
15 async fn locate(
18 &self,
19 options: super::domain::positioning::GooglePositioningOptions,
20 ) -> EveryMapResult<super::domain::positioning::GoogleGeolocationResponse>;
21}
22
23#[async_trait]
33pub trait GoogleAttributeExt: Send + Sync {
34 async fn get_speed_limits_by_ids(
37 &self,
38 place_ids: &[String],
39 units: Option<&str>,
40 ) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse>;
41
42 async fn get_speed_limits_along_path(
45 &self,
46 path: &str,
47 units: Option<&str>,
48 ) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse>;
49}
50
51#[async_trait]
54impl GooglePositionerExt for super::domain::positioning::GooglePositioner {
55 async fn locate(
56 &self,
57 options: super::domain::positioning::GooglePositioningOptions,
58 ) -> EveryMapResult<super::domain::positioning::GoogleGeolocationResponse> {
59 self.locate(options).await
60 }
61}
62
63#[async_trait]
64impl GoogleAttributeExt for super::domain::attributes::GoogleAttributeProvider {
65 async fn get_speed_limits_by_ids(
66 &self,
67 place_ids: &[String],
68 units: Option<&str>,
69 ) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse> {
70 self.get_speed_limits_by_ids(place_ids, units).await
71 }
72
73 async fn get_speed_limits_along_path(
74 &self,
75 path: &str,
76 units: Option<&str>,
77 ) -> EveryMapResult<super::domain::attributes::GoogleSpeedLimitsResponse> {
78 self.get_speed_limits_along_path(path, units).await
79 }
80}