Download packages/tauri-plugins/plugins/geolocation/src/commands.rs from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/geolocation/src/commands.rs
- Command line
-
hf download hf://datasets/echodict/readest/packages/tauri-plugins/plugins/geolocation/src/commands.rs
-
curl -L -o commands.rs https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/geolocation/src/commands.rs
1.25 kB
| // Copyright 2019-2023 Tauri Programme within The Commons Conservancy | |
| // SPDX-License-Identifier: Apache-2.0 | |
| // SPDX-License-Identifier: MIT | |
| use tauri::{command, ipc::Channel, AppHandle, Runtime}; | |
| use crate::{GeolocationExt, PermissionStatus, PermissionType, Position, PositionOptions, Result}; | |
| pub(crate) async fn get_current_position<R: Runtime>( | |
| app: AppHandle<R>, | |
| options: Option<PositionOptions>, | |
| ) -> Result<Position> { | |
| app.geolocation().get_current_position(options) | |
| } | |
| pub(crate) async fn watch_position<R: Runtime>( | |
| app: AppHandle<R>, | |
| options: PositionOptions, | |
| channel: Channel, | |
| ) -> Result<()> { | |
| app.geolocation().watch_position_inner(options, channel) | |
| } | |
| pub(crate) async fn clear_watch<R: Runtime>(app: AppHandle<R>, channel_id: u32) -> Result<()> { | |
| app.geolocation().clear_watch(channel_id) | |
| } | |
| pub(crate) async fn check_permissions<R: Runtime>(app: AppHandle<R>) -> Result<PermissionStatus> { | |
| app.geolocation().check_permissions() | |
| } | |
| pub(crate) async fn request_permissions<R: Runtime>( | |
| app: AppHandle<R>, | |
| permissions: Option<Vec<PermissionType>>, | |
| ) -> Result<PermissionStatus> { | |
| app.geolocation().request_permissions(permissions) | |
| } | |