pub struct Geolocation<R: Runtime>(/* private fields */);
Expand description
Access to the geolocation APIs.
Implementations§
Source§impl<R: Runtime> Geolocation<R>
impl<R: Runtime> Geolocation<R>
pub fn get_current_position( &self, options: Option<PositionOptions>, ) -> Result<Position>
Sourcepub fn watch_position<F: Fn(WatchEvent) + Send + Sync + 'static>(
&self,
options: PositionOptions,
callback: F,
) -> Result<u32>
pub fn watch_position<F: Fn(WatchEvent) + Send + Sync + 'static>( &self, options: PositionOptions, callback: F, ) -> Result<u32>
Register a position watcher. This method returns an id to use in clear_watch
.
pub fn clear_watch(&self, channel_id: u32) -> Result<()>
pub fn check_permissions(&self) -> Result<PermissionStatus>
pub fn request_permissions( &self, permissions: Option<Vec<PermissionType>>, ) -> Result<PermissionStatus>
Auto Trait Implementations§
impl<R> Freeze for Geolocation<R>
impl<R> !RefUnwindSafe for Geolocation<R>
impl<R> Send for Geolocation<R>
impl<R> Sync for Geolocation<R>
impl<R> Unpin for Geolocation<R>
impl<R> !UnwindSafe for Geolocation<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more