pub struct GPS { /* private fields */ }Expand description
GPS Time.
GPS Time is a continuous time scale used by the Global Positioning System. It started at midnight UTC on January 6, 1980 (the GPS epoch) and does not include leap seconds.
GPS = TAI - 19 seconds
Implementations§
Source§impl GPS
impl GPS
Sourcepub const GPS_EPOCH_UNIX: i64 = 315_964_800i64
pub const GPS_EPOCH_UNIX: i64 = 315_964_800i64
GPS epoch in Unix seconds.
Sourcepub fn from_week_and_seconds(week: u32, seconds_of_week: f64) -> Self
pub fn from_week_and_seconds(week: u32, seconds_of_week: f64) -> Self
Create from GPS week number and seconds of week.
Sourcepub fn to_week_and_seconds(&self) -> (u32, f64)
pub fn to_week_and_seconds(&self) -> (u32, f64)
Convert to GPS week number and seconds of week.
Sourcepub fn week_number(&self) -> u32
pub fn week_number(&self) -> u32
Get GPS week number.
Sourcepub fn seconds_of_week(&self) -> f64
pub fn seconds_of_week(&self) -> f64
Get seconds of week (0 to 604800).
Sourcepub fn day_of_week(&self) -> u32
pub fn day_of_week(&self) -> u32
Get day of week (0 = Sunday).
Sourcepub fn add_seconds(&self, seconds: f64) -> Self
pub fn add_seconds(&self, seconds: f64) -> Self
Add seconds to the GPS time.
Trait Implementations§
impl Copy for GPS
impl StructuralPartialEq for GPS
Auto Trait Implementations§
impl Freeze for GPS
impl RefUnwindSafe for GPS
impl Send for GPS
impl Sync for GPS
impl Unpin for GPS
impl UnwindSafe for GPS
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