Struct statime::config::TimePropertiesDS
source · pub struct TimePropertiesDS {
pub current_utc_offset: Option<i16>,
pub leap_indicator: LeapIndicator,
pub time_traceable: bool,
pub frequency_traceable: bool,
pub ptp_timescale: bool,
pub time_source: TimeSource,
}
Expand description
A concrete implementation of the PTP Time Properties dataset
This dataset describes the timescale currently in use, as well as any upcoming leap seconds on that timescale.
For more details see IEEE1588-2019 section 8.2.4.
Fields§
§current_utc_offset: Option<i16>
The offset off UTC time compared to TAI time in seconds.
leap_indicator: LeapIndicator
Describes upcoming leap seconds.
time_traceable: bool
Wheter the timescale is tracable to a primary reference
frequency_traceable: bool
Wheter the frequence determining the timescale is tracable to a primary reference. True when the timescale is PTP, false when the timescale is ARB.
ptp_timescale: bool
Wheter the timescale of the Grandmaster PTP Instance is PTP.
time_source: TimeSource
The time source used by the Grandmaster PTP instance.
Implementations§
source§impl TimePropertiesDS
impl TimePropertiesDS
sourcepub fn new_ptp_time(
current_utc_offset: Option<i16>,
leap_indicator: LeapIndicator,
time_traceable: bool,
frequency_traceable: bool,
time_source: TimeSource,
) -> Self
pub fn new_ptp_time( current_utc_offset: Option<i16>, leap_indicator: LeapIndicator, time_traceable: bool, frequency_traceable: bool, time_source: TimeSource, ) -> Self
Create a Time Properties data set for the PTP timescale.
This creates a dataset for the default PTP timescale, which is UTC seconds since the PTP epoch excluding leap seconds. The traceability properties indicate whether the current clock time and frequency can be traced back to an internationally recognized standard in the metrology sense of the word. When in doubt, just set these to false.
sourcepub fn new_arbitrary_time(
time_traceable: bool,
frequency_traceable: bool,
time_source: TimeSource,
) -> Self
pub fn new_arbitrary_time( time_traceable: bool, frequency_traceable: bool, time_source: TimeSource, ) -> Self
Create a Time Properties data set for an Arbitrary timescale
The arbitrary timescale can be used when wanting to synchronize multiple computers using PTP to a timescale that is unrelated to UTC. The traceability properties indicate whether the current clock time and frequency can be traced back to an internationally recognized standard in the metrology sense of the word. When in doubt, just set these to false.
sourcepub fn leap_indicator(&self) -> LeapIndicator
pub fn leap_indicator(&self) -> LeapIndicator
Information on upcoming leap seconds
sourcepub fn utc_offset(&self) -> Option<i16>
pub fn utc_offset(&self) -> Option<i16>
Current offset to UTC caused by leap seconds
Returns None
if this time scale is not referenced to UTC
Trait Implementations§
source§impl Clone for TimePropertiesDS
impl Clone for TimePropertiesDS
source§fn clone(&self) -> TimePropertiesDS
fn clone(&self) -> TimePropertiesDS
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TimePropertiesDS
impl Debug for TimePropertiesDS
source§impl Default for TimePropertiesDS
impl Default for TimePropertiesDS
source§fn default() -> TimePropertiesDS
fn default() -> TimePropertiesDS
source§impl<'de> Deserialize<'de> for TimePropertiesDS
impl<'de> Deserialize<'de> for TimePropertiesDS
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for TimePropertiesDS
impl PartialEq for TimePropertiesDS
source§fn eq(&self, other: &TimePropertiesDS) -> bool
fn eq(&self, other: &TimePropertiesDS) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TimePropertiesDS
impl Serialize for TimePropertiesDS
impl Copy for TimePropertiesDS
impl Eq for TimePropertiesDS
impl StructuralPartialEq for TimePropertiesDS
Auto Trait Implementations§
impl Freeze for TimePropertiesDS
impl RefUnwindSafe for TimePropertiesDS
impl Send for TimePropertiesDS
impl Sync for TimePropertiesDS
impl Unpin for TimePropertiesDS
impl UnwindSafe for TimePropertiesDS
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)