pub struct Latitude(/* private fields */);Expand description
Geographic latitude in decimal degrees, validated to [-90.0, 90.0].
Positive = North, negative = South. Rejects NaN and out-of-range
values. Use Self::new for fallible construction and
Self::new_clamped when you prefer silent clamping.
Implementations§
Source§impl Latitude
impl Latitude
Sourcepub fn new(degrees: f64) -> Result<Self, AprsError>
pub fn new(degrees: f64) -> Result<Self, AprsError>
Create a latitude, rejecting NaN or out-of-range values.
§Errors
Returns AprsError::InvalidLatitude if degrees is not finite
or not in [-90.0, 90.0].
Sourcepub fn new_clamped(degrees: f64) -> Self
pub fn new_clamped(degrees: f64) -> Self
Create a latitude, clamping any input to [-90.0, 90.0]. NaN
becomes 0.0.
Sourcepub const fn as_degrees(self) -> f64
pub const fn as_degrees(self) -> f64
Return the latitude as decimal degrees.
Sourcepub fn as_aprs_uncompressed(self) -> String
pub fn as_aprs_uncompressed(self) -> String
Format this latitude as the standard APRS uncompressed 8-byte
field DDMM.HHN (or …S for southern hemisphere).
Trait Implementations§
Source§impl PartialOrd for Latitude
impl PartialOrd for Latitude
impl Copy for Latitude
impl StructuralPartialEq for Latitude
Auto Trait Implementations§
impl Freeze for Latitude
impl RefUnwindSafe for Latitude
impl Send for Latitude
impl Sync for Latitude
impl Unpin for Latitude
impl UnwindSafe for Latitude
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