pub struct GpstSeconds(pub i64);Expand description
Continuous seconds count in the GPS time scale.
GPST is offset from TAI by exactly 19 seconds: GPST = TAI − 19.
The inner i64 counts seconds since the Unix epoch in GPST.
Convert to/from TAI with tai_to_gpst and
gpst_to_tai. Convert to/from UTC via
LeapSeconds::utc_to_gpst.
§Example
use leap_sec::GpstSeconds;
let gpst = GpstSeconds(1_700_000_018);
assert_eq!(format!("{gpst}"), "1700000018 GPST");Tuple Fields§
§0: i64Trait Implementations§
Source§impl Clone for GpstSeconds
impl Clone for GpstSeconds
Source§fn clone(&self) -> GpstSeconds
fn clone(&self) -> GpstSeconds
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 GpstSeconds
impl Debug for GpstSeconds
Source§impl Display for GpstSeconds
Displays as "{seconds} GPST" (e.g., "1700000018 GPST").
impl Display for GpstSeconds
Displays as "{seconds} GPST" (e.g., "1700000018 GPST").
Source§impl From<GpstSeconds> for GpstNanos
Lossless promotion: multiplies by 1,000,000,000.
impl From<GpstSeconds> for GpstNanos
Lossless promotion: multiplies by 1,000,000,000.
Source§fn from(s: GpstSeconds) -> Self
fn from(s: GpstSeconds) -> Self
Converts to this type from the input type.
Source§impl Hash for GpstSeconds
impl Hash for GpstSeconds
Source§impl Ord for GpstSeconds
impl Ord for GpstSeconds
Source§fn cmp(&self, other: &GpstSeconds) -> Ordering
fn cmp(&self, other: &GpstSeconds) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GpstSeconds
impl PartialEq for GpstSeconds
Source§impl PartialOrd for GpstSeconds
impl PartialOrd for GpstSeconds
impl Copy for GpstSeconds
impl Eq for GpstSeconds
impl StructuralPartialEq for GpstSeconds
Auto Trait Implementations§
impl Freeze for GpstSeconds
impl RefUnwindSafe for GpstSeconds
impl Send for GpstSeconds
impl Sync for GpstSeconds
impl Unpin for GpstSeconds
impl UnsafeUnpin for GpstSeconds
impl UnwindSafe for GpstSeconds
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