pub struct Gps;Expand description
GPS — American Global Positioning System
- Epoch: 1980-01-06 UTC
- GPS = TAI − 19 seconds
- No leap seconds (fixed offset)
- Format:
"GPS 2345:432000.000"
Trait Implementations§
Source§impl IntoScale<Gps> for Time<Beidou>
impl IntoScale<Gps> for Time<Beidou>
Source§fn into_scale(self) -> Result<Time<Gps>, GnssTimeError>
fn into_scale(self) -> Result<Time<Gps>, GnssTimeError>
BeiDou -> GPS: GPS = BDT + 14s.
use gnss_time::{Beidou, Gps, IntoScale, Time};
let bdt = Time::<Beidou>::from_seconds(86);
let gps: Time<Gps> = bdt.into_scale().unwrap();
assert_eq!(gps.as_seconds(), 100); // 86 - 19 + 33 = 100Source§impl IntoScale<Gps> for Time<Galileo>
impl IntoScale<Gps> for Time<Galileo>
Source§fn into_scale(self) -> Result<Time<Gps>, GnssTimeError>
fn into_scale(self) -> Result<Time<Gps>, GnssTimeError>
Converts the value into the target time scale. Read more
Source§impl IntoScale<Gps> for Time<Tai>
impl IntoScale<Gps> for Time<Tai>
Source§fn into_scale(self) -> Result<Time<Gps>, GnssTimeError>
fn into_scale(self) -> Result<Time<Gps>, GnssTimeError>
TAI -> GPS: subtract 19 seconds.
use gnss_time::{Gps, IntoScale, Tai, Time};
let tai = Time::<Tai>::from_seconds(119);
let gps: Time<Gps> = tai.into_scale().unwrap();
assert_eq!(gps.as_seconds(), 100);Source§impl IntoScaleWith<Gps> for Time<Glonass>
impl IntoScaleWith<Gps> for Time<Glonass>
Source§fn into_scale_with<P: LeapSecondsProvider>(
self,
ls: P,
) -> Result<Time<Gps>, GnssTimeError>
fn into_scale_with<P: LeapSecondsProvider>( self, ls: P, ) -> Result<Time<Gps>, GnssTimeError>
GLONASS -> GPS via UTC.
Source§fn into_scale_with_checked<P: LeapSecondsProvider>(
self,
ls: P,
) -> Result<ConvertResult<Time<Gps>>, GnssTimeError>
fn into_scale_with_checked<P: LeapSecondsProvider>( self, ls: P, ) -> Result<ConvertResult<Time<Gps>>, GnssTimeError>
Converts and reports whether the result is ambiguous due to a
leap-second insertion.
Source§impl IntoScaleWith<Gps> for Time<Utc>
impl IntoScaleWith<Gps> for Time<Utc>
Source§fn into_scale_with<P: LeapSecondsProvider>(
self,
ls: P,
) -> Result<Time<Gps>, GnssTimeError>
fn into_scale_with<P: LeapSecondsProvider>( self, ls: P, ) -> Result<Time<Gps>, GnssTimeError>
UTC -> GPS with leap-second context.
use gnss_time::{DurationParts, Gps, IntoScale, IntoScaleWith, LeapSeconds, Time, Utc};
let ls = LeapSeconds::builtin();
let gps_orig = Time::<Gps>::from_week_tow(
2086,
DurationParts {
seconds: 0,
nanos: 0,
},
)
.unwrap();
let utc: Time<Utc> = gps_orig.into_scale_with(ls).unwrap();
let gps_back: Time<Gps> = utc.into_scale_with(ls).unwrap();
assert_eq!(gps_orig, gps_back);Source§fn into_scale_with_checked<P: LeapSecondsProvider>(
self,
ls: P,
) -> Result<ConvertResult<Time<Gps>>, GnssTimeError>
fn into_scale_with_checked<P: LeapSecondsProvider>( self, ls: P, ) -> Result<ConvertResult<Time<Gps>>, GnssTimeError>
Converts and reports whether the result is ambiguous due to a
leap-second insertion.
Source§impl TimeScale for Gps
impl TimeScale for Gps
Source§const OFFSET_TO_TAI: OffsetToTai
const OFFSET_TO_TAI: OffsetToTai
Offset relative to TAI: Read more
Source§const EPOCH_CIVIL: CivilDate
const EPOCH_CIVIL: CivilDate
Civil epoch of the scale (where time == 0).
Source§const DISPLAY_STYLE: DisplayStyle = DisplayStyle::WeekTow
const DISPLAY_STYLE: DisplayStyle = DisplayStyle::WeekTow
Formatting style for display output.
impl Copy for Gps
impl Eq 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 UnsafeUnpin 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