pub struct LocationManager { /* private fields */ }Expand description
Manages CoreLocation access for getting the user’s current location.
CLLocationManager is !Send + !Sync — create instances on the thread
where you need them (same pattern as EventKit managers).
Implementations§
Source§impl LocationManager
impl LocationManager
Check the current authorization status for location services.
Request when-in-use authorization for location services.
On macOS, this shows the system permission dialog. The result is
available via authorization_status() after the user responds.
Sourcepub fn cached_location(&self) -> Option<Coordinate>
pub fn cached_location(&self) -> Option<Coordinate>
Get the most recently cached location without starting updates.
Returns None if no location has been determined yet.
Sourcepub fn get_current_location(&self, timeout: Duration) -> Result<Coordinate>
pub fn get_current_location(&self, timeout: Duration) -> Result<Coordinate>
Request a fresh location fix synchronously (blocks until result or timeout).
Starts location updates, waits for a result, then stops updates.
Times out after timeout duration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocationManager
impl !RefUnwindSafe for LocationManager
impl !Send for LocationManager
impl !Sync for LocationManager
impl Unpin for LocationManager
impl UnsafeUnpin for LocationManager
impl !UnwindSafe for LocationManager
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