Skip to main content

lingxia_platform/traits/
location.rs

1use std::future::Future;
2
3use crate::error::PlatformError;
4
5#[derive(Debug, Clone, Default)]
6pub struct LocationRequestConfig {
7    pub is_high_accuracy: bool,
8    pub high_accuracy_expire_time: Option<u32>,
9    pub include_altitude: bool,
10}
11
12pub trait Location: Send + Sync + 'static {
13    fn is_location_enabled(&self) -> Result<bool, PlatformError>;
14
15    fn request_location(
16        &self,
17        config: LocationRequestConfig,
18    ) -> impl Future<Output = Result<String, PlatformError>> + Send;
19}