use async_trait::async_trait;
use everymap_core::error::EveryMapResult;
#[async_trait]
pub trait HereGeocoderExt: Send + Sync {
async fn discover(
&self,
req: super::domain::search::DiscoverRequest,
) -> EveryMapResult<super::domain::search::HereDiscoverResponse>;
async fn autosuggest(
&self,
req: super::domain::search::AutosuggestRequest,
) -> EveryMapResult<super::domain::search::HereAutosuggestResponse>;
}
#[async_trait]
pub trait HereTrafficExt: Send + Sync {
async fn get_flow(
&self,
location: everymap_core::types::Coordinate,
options: &super::domain::traffic::HereFlowOptions,
) -> EveryMapResult<super::domain::traffic::HereFlowResponse>;
async fn get_incidents(
&self,
options: &super::domain::traffic::HereIncidentsOptions,
) -> EveryMapResult<super::domain::traffic::HereIncidentsResponse>;
}
#[async_trait]
pub trait HerePositionerExt: Send + Sync {
async fn locate(
&self,
options: super::domain::positioning::HerePositioningOptions,
) -> EveryMapResult<super::domain::positioning::PositioningResponse>;
}
#[async_trait]
pub trait HereTourPlannerExt: Send + Sync {
async fn solve(
&self,
problem: super::domain::tour::TourProblem,
) -> EveryMapResult<super::domain::tour::TourSolution>;
async fn solve_async(
&self,
problem: super::domain::tour::TourProblem,
) -> EveryMapResult<super::domain::tour::AsyncSubmissionResult>;
async fn get_async_status(
&self,
status_id: &str,
) -> EveryMapResult<super::domain::tour::AsyncJobStatus>;
async fn get_solution(
&self,
problem_id: &str,
) -> EveryMapResult<super::domain::tour::TourSolution>;
async fn cancel(
&self,
problem_id: &str,
) -> EveryMapResult<super::domain::tour::CancellationStatus>;
async fn version(&self) -> EveryMapResult<super::domain::tour::VersionResponse>;
async fn health(&self) -> EveryMapResult<super::domain::tour::HealthResponse>;
}
#[async_trait]
pub trait HereAttributeExt: Send + Sync {
async fn get_road_attributes(
&self,
bbox: &str,
includes: Option<Vec<String>>,
) -> EveryMapResult<super::domain::attributes::HereRoadAttributesResponse>;
async fn get_segment_attributes(
&self,
bbox: &str,
includes: Option<Vec<String>>,
) -> EveryMapResult<super::domain::attributes::HereSegmentAttributesResponse>;
async fn get_admin_areas(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereAdminAreasResponse>;
async fn get_buildings(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereBuildingsResponse>;
async fn get_landmarks(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereLandmarksResponse>;
async fn get_road_attributes_by_ids(
&self,
ids: &[String],
) -> EveryMapResult<super::domain::attributes::HereRoadAttributesResponse>;
async fn get_speed_limits(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereRoadAttributesResponse>;
}
#[async_trait]
impl HereGeocoderExt for super::domain::search::HereGeocoder {
async fn discover(
&self,
req: super::domain::search::DiscoverRequest,
) -> EveryMapResult<super::domain::search::HereDiscoverResponse> {
self.discover(req).await
}
async fn autosuggest(
&self,
req: super::domain::search::AutosuggestRequest,
) -> EveryMapResult<super::domain::search::HereAutosuggestResponse> {
self.autosuggest(req).await
}
}
#[async_trait]
impl HereTrafficExt for super::domain::traffic::HereTraffic {
async fn get_flow(
&self,
location: everymap_core::types::Coordinate,
options: &super::domain::traffic::HereFlowOptions,
) -> EveryMapResult<super::domain::traffic::HereFlowResponse> {
self.get_flow(location, options).await
}
async fn get_incidents(
&self,
options: &super::domain::traffic::HereIncidentsOptions,
) -> EveryMapResult<super::domain::traffic::HereIncidentsResponse> {
self.get_incidents(options).await
}
}
#[async_trait]
impl HerePositionerExt for super::domain::positioning::HerePositioner {
async fn locate(
&self,
options: super::domain::positioning::HerePositioningOptions,
) -> EveryMapResult<super::domain::positioning::PositioningResponse> {
self.locate(options).await
}
}
#[async_trait]
impl HereTourPlannerExt for super::domain::tour::HereTourPlanner {
async fn solve(
&self,
problem: super::domain::tour::TourProblem,
) -> EveryMapResult<super::domain::tour::TourSolution> {
self.solve(problem).await
}
async fn solve_async(
&self,
problem: super::domain::tour::TourProblem,
) -> EveryMapResult<super::domain::tour::AsyncSubmissionResult> {
self.solve_async(problem).await
}
async fn get_async_status(
&self,
status_id: &str,
) -> EveryMapResult<super::domain::tour::AsyncJobStatus> {
self.get_async_status(status_id).await
}
async fn get_solution(
&self,
problem_id: &str,
) -> EveryMapResult<super::domain::tour::TourSolution> {
self.get_solution(problem_id).await
}
async fn cancel(
&self,
problem_id: &str,
) -> EveryMapResult<super::domain::tour::CancellationStatus> {
self.cancel(problem_id).await
}
async fn version(&self) -> EveryMapResult<super::domain::tour::VersionResponse> {
self.version().await
}
async fn health(&self) -> EveryMapResult<super::domain::tour::HealthResponse> {
self.health().await
}
}
#[async_trait]
impl HereAttributeExt for super::domain::attributes::HereAttributeProvider {
async fn get_road_attributes(
&self,
bbox: &str,
includes: Option<Vec<String>>,
) -> EveryMapResult<super::domain::attributes::HereRoadAttributesResponse> {
self.get_road_attributes(bbox, includes).await
}
async fn get_segment_attributes(
&self,
bbox: &str,
includes: Option<Vec<String>>,
) -> EveryMapResult<super::domain::attributes::HereSegmentAttributesResponse> {
self.get_segment_attributes(bbox, includes).await
}
async fn get_admin_areas(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereAdminAreasResponse> {
self.get_admin_areas(bbox).await
}
async fn get_buildings(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereBuildingsResponse> {
self.get_buildings(bbox).await
}
async fn get_landmarks(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereLandmarksResponse> {
self.get_landmarks(bbox).await
}
async fn get_road_attributes_by_ids(
&self,
ids: &[String],
) -> EveryMapResult<super::domain::attributes::HereRoadAttributesResponse> {
self.get_road_attributes_by_ids(ids).await
}
async fn get_speed_limits(
&self,
bbox: &str,
) -> EveryMapResult<super::domain::attributes::HereRoadAttributesResponse> {
self.get_speed_limits(bbox).await
}
}