pub struct GeolocationPosition {
pub latitude: f64,
pub longitude: f64,
pub accuracy: f64,
pub altitude: Option<f64>,
pub altitude_accuracy: Option<f64>,
pub heading: Option<f64>,
pub speed: Option<f64>,
}Expand description
Geographic position with coordinates and accuracy
Fields§
§latitude: f64Latitude in decimal degrees (-90.0 to 90.0)
longitude: f64Longitude in decimal degrees (-180.0 to 180.0)
accuracy: f64Accuracy in meters
altitude: Option<f64>Altitude in meters (optional)
altitude_accuracy: Option<f64>Altitude accuracy in meters (optional)
heading: Option<f64>Heading in degrees (0-360, optional)
speed: Option<f64>Speed in meters per second (optional)
Implementations§
Source§impl GeolocationPosition
impl GeolocationPosition
Sourcepub fn with_altitude(self, altitude: f64, accuracy: f64) -> Self
pub fn with_altitude(self, altitude: f64, accuracy: f64) -> Self
Set altitude
Sourcepub fn with_heading(self, heading: f64) -> Self
pub fn with_heading(self, heading: f64) -> Self
Set heading (direction of travel)
Sourcepub fn with_speed(self, speed: f64) -> Self
pub fn with_speed(self, speed: f64) -> Self
Set speed
Sourcepub fn san_francisco() -> Self
pub fn san_francisco() -> Self
San Francisco, USA (Golden Gate Bridge)
Trait Implementations§
Source§impl Clone for GeolocationPosition
impl Clone for GeolocationPosition
Source§fn clone(&self) -> GeolocationPosition
fn clone(&self) -> GeolocationPosition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GeolocationPosition
impl Debug for GeolocationPosition
Source§impl PartialEq for GeolocationPosition
impl PartialEq for GeolocationPosition
Source§fn eq(&self, other: &GeolocationPosition) -> bool
fn eq(&self, other: &GeolocationPosition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GeolocationPosition
Auto Trait Implementations§
impl Freeze for GeolocationPosition
impl RefUnwindSafe for GeolocationPosition
impl Send for GeolocationPosition
impl Sync for GeolocationPosition
impl Unpin for GeolocationPosition
impl UnsafeUnpin for GeolocationPosition
impl UnwindSafe for GeolocationPosition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more