Struct location_history::Location
[−]
[src]
pub struct Location { pub timestamp: NaiveDateTime, pub latitude: f64, pub longitude: f64, pub accuracy: i32, pub altitude: Option<i32>, }
Location sample parsed from LocationHistory.json
Fields
timestamp: NaiveDateTime
timestamp this location was sampled at, converted from milliseconds
latitude: f64
latitude, converted from lat E7
longitude: f64
longitude, converted from long E7
accuracy: i32
accuracy of location sample in meters
altitude: Option<i32>
altitude in meters, if available
Methods
impl Location
[src]
pub fn haversine_distance(&self, other: &Location) -> f64
[src]
calculate the haversine distance between this and another location
pub fn speed_kmh(&self, other: &Location) -> f64
[src]
calculate the speed in km/h from this location to another location
Trait Implementations
impl Copy for Location
[src]
impl Clone for Location
[src]
fn clone(&self) -> Location
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more