pub struct Timestamp { /* private fields */ }
Expand description
Representation of time instants in DDS API and RTPS protocol. Similar to
std::time::Instant
.
Quoting RTPS 2.3 spec 9.3.2.1:
The representation of the time is the one defined by the IETF Network Time Protocol (NTP) Standard (IETF RFC 1305). In this representation, time is expressed in seconds and fraction of seconds using the formula: time = seconds + (fraction / 2^(32))
The time origin is represented by the reserved value TIME_ZERO and corresponds to the UNIX prime epoch 0h, 1 January 1970.
Note : While NTP uses the same time representation as RTPS, it does not use the Unix epoch (1970-01-01 00:00). NTP uses the beginning of the 20th century epoch (1900-01-01 00:00) instead. So the RTPS timestamps are not interchangeable with NTP.
The timestamps will overflow in year 2106.
This type is called Time_t in the RTPS spec.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
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 Ord for Timestamp
impl Ord for Timestamp
source§impl PartialEq<Timestamp> for Timestamp
impl PartialEq<Timestamp> for Timestamp
source§impl PartialOrd<Timestamp> for Timestamp
impl PartialOrd<Timestamp> for Timestamp
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more