Fix

Struct Fix 

Source
pub struct Fix {
    pub quality: FixQuality,
    pub latitude_e7: Option<i32>,
    pub longitude_e7: Option<i32>,
    pub altitude_m: Option<i32>,
    pub hdop_centi: Option<u16>,
    pub sats_used: u8,
    pub sats_in_view: Option<u8>,
    pub time: Option<DateTime>,
    pub time_from_fix: bool,
}
Expand description

Everything one cycle of sentences said, in integers.

Coordinates are in units of 1e-7 degrees — about 11 mm, and exact, because they were parsed from the receiver’s decimal digits without ever passing through a float.

Fields§

§quality: FixQuality

The dimension of the solution.

§latitude_e7: Option<i32>

Latitude in 1e-7 degrees, positive north. None without a fix.

§longitude_e7: Option<i32>

Longitude in 1e-7 degrees, positive east. None without a fix.

§altitude_m: Option<i32>

Altitude above mean sea level in meters, with a three-dimensional solution.

§hdop_centi: Option<u16>

Horizontal dilution of precision, in hundredths.

§sats_used: u8

Satellites contributing to the solution.

§sats_in_view: Option<u8>

Satellites in view, summed across constellations. None when the receiver reported no GSV since the last cycle.

§time: Option<DateTime>

The UTC instant the receiver reported, if it reported one.

Present without a position more often than one might expect: a receiver with a running real-time clock emits the time in every RMC while it is still searching for satellites.

§time_from_fix: bool

Whether time accompanied a valid position.

The distinction matters to a caller deciding how much to trust the instant: a time that came with a fix was disciplined by the satellites this second, and one that did not came from whatever the receiver has been keeping on its own.

Implementations§

Source§

impl Fix

Source

pub const fn has_position(&self) -> bool

Whether the cycle produced a position at all.

Trait Implementations§

Source§

impl Clone for Fix

Source§

fn clone(&self) -> Fix

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Fix

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Fix

Source§

fn default() -> Fix

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Fix

Source§

fn eq(&self, other: &Fix) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Fix

Source§

impl Eq for Fix

Source§

impl StructuralPartialEq for Fix

Auto Trait Implementations§

§

impl Freeze for Fix

§

impl RefUnwindSafe for Fix

§

impl Send for Fix

§

impl Sync for Fix

§

impl Unpin for Fix

§

impl UnwindSafe for Fix

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.