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

source

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.

source

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.

source

pub fn is_ptp(&self) -> bool

Is this timescale a ptp (utc-derived) timescale?

source

pub fn leap_indicator(&self) -> LeapIndicator

Information on upcoming leap seconds

source

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

source§

fn clone(&self) -> TimePropertiesDS

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for TimePropertiesDS

source§

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

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

impl Default for TimePropertiesDS

source§

fn default() -> TimePropertiesDS

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

impl<'de> Deserialize<'de> for TimePropertiesDS

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for TimePropertiesDS

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for TimePropertiesDS

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for TimePropertiesDS

source§

impl Eq for TimePropertiesDS

source§

impl StructuralPartialEq for TimePropertiesDS

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,