pub struct GeoCoordinate {
pub lat: f64,
pub lng: f64,
pub altitude: f64,
}Expand description
Geographic coordinates (Latitude, Longitude) with optional Altitude.
Fields§
§lat: f64§lng: f64§altitude: f64Altitude above sea level in meters. Default: 0.0
Implementations§
Source§impl GeoCoordinate
impl GeoCoordinate
Sourcepub fn new(lat: f64, lng: f64) -> Result<Self, ShaumError>
pub fn new(lat: f64, lng: f64) -> Result<Self, ShaumError>
Creates a new validated coordinate (altitude defaults to 0).
Returns Err(ShaumError::ValidationError) if coordinates are out of range.
Sourcepub const fn new_unchecked(lat: f64, lng: f64) -> Self
pub const fn new_unchecked(lat: f64, lng: f64) -> Self
Creates a coordinate without validation. Use with trusted inputs only.
Sourcepub fn with_altitude(self, altitude: f64) -> Self
pub fn with_altitude(self, altitude: f64) -> Self
Sets the altitude (meters above sea level).
Trait Implementations§
Source§impl Clone for GeoCoordinate
impl Clone for GeoCoordinate
Source§fn clone(&self) -> GeoCoordinate
fn clone(&self) -> GeoCoordinate
Returns a duplicate of the value. Read more
1.0.0 · 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 GeoCoordinate
impl Debug for GeoCoordinate
Source§impl<'de> Deserialize<'de> for GeoCoordinate
impl<'de> Deserialize<'de> for GeoCoordinate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GeoCoordinate
impl PartialEq for GeoCoordinate
Source§impl Serialize for GeoCoordinate
impl Serialize for GeoCoordinate
impl Copy for GeoCoordinate
impl StructuralPartialEq for GeoCoordinate
Auto Trait Implementations§
impl Freeze for GeoCoordinate
impl RefUnwindSafe for GeoCoordinate
impl Send for GeoCoordinate
impl Sync for GeoCoordinate
impl Unpin for GeoCoordinate
impl UnwindSafe for GeoCoordinate
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