[][src]Struct location_history::Location

pub struct Location {
    pub timestamp: NaiveDateTime,
    pub latitude: f32,
    pub longitude: f32,
    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: f32

latitude, converted from lat E7

longitude: f32

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) -> f32[src]

calculate the haversine distance between this and another location

pub fn speed_kmh(&self, other: &Location) -> f32[src]

calculate the speed in km/h from this location to another location

Trait Implementations

impl Clone for Location[src]

impl Copy for Location[src]

impl Debug for Location[src]

impl<'de> Deserialize<'de> for Location[src]

impl Serialize for Location[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.