pub trait LocationExt: IsA<Location> + 'static {
// Provided methods
fn distance(&self, other: &impl IsA<Location>) -> f64 { ... }
fn latitude(&self) -> f64 { ... }
fn longitude(&self) -> f64 { ... }
fn set_location(&self, latitude: f64, longitude: f64) { ... }
fn set_latitude(&self, latitude: f64) { ... }
fn set_longitude(&self, longitude: f64) { ... }
fn connect_latitude_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_longitude_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Provided Methods§
Sourcefn distance(&self, other: &impl IsA<Location>) -> f64
fn distance(&self, other: &impl IsA<Location>) -> f64
Calculates the distance in meters between two locations.
This function uses the great-circle distance formula, which assumes Earth is a perfect sphere. This limits the accuracy of the result, but is good enough for most purposes.
§other
a Location
§Returns
the distance in meters between @self and @other
Sourcefn set_location(&self, latitude: f64, longitude: f64)
fn set_location(&self, latitude: f64, longitude: f64)
Sourcefn set_latitude(&self, latitude: f64)
fn set_latitude(&self, latitude: f64)
The latitude coordonate in degrees
Sourcefn set_longitude(&self, longitude: f64)
fn set_longitude(&self, longitude: f64)
The longitude coordonate in degrees
fn connect_latitude_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_longitude_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.