pub struct Longitude(/* private fields */);Expand description
Geographic longitude in decimal degrees, validated to [-180.0, 180.0].
Positive = East, negative = West. Rejects NaN and out-of-range values.
Implementations§
Source§impl Longitude
impl Longitude
Sourcepub fn new(degrees: f64) -> Result<Self, AprsError>
pub fn new(degrees: f64) -> Result<Self, AprsError>
Create a longitude, rejecting NaN or out-of-range values.
§Errors
Returns AprsError::InvalidLongitude if degrees is not finite
or not in [-180.0, 180.0].
Sourcepub fn new_clamped(degrees: f64) -> Self
pub fn new_clamped(degrees: f64) -> Self
Create a longitude, clamping to [-180.0, 180.0]. NaN → 0.0.
Sourcepub const fn as_degrees(self) -> f64
pub const fn as_degrees(self) -> f64
Return the longitude as decimal degrees.
Sourcepub fn as_aprs_uncompressed(self) -> String
pub fn as_aprs_uncompressed(self) -> String
Format this longitude as the standard APRS uncompressed 9-byte
field DDDMM.HHE (or …W for western hemisphere).
Trait Implementations§
Source§impl PartialOrd for Longitude
impl PartialOrd for Longitude
impl Copy for Longitude
impl StructuralPartialEq for Longitude
Auto Trait Implementations§
impl Freeze for Longitude
impl RefUnwindSafe for Longitude
impl Send for Longitude
impl Sync for Longitude
impl Unpin for Longitude
impl UnwindSafe for Longitude
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