Struct rustdds::dds::data_types::DDSTimestamp [−][src]
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 : NTP does not use the Unix epoch (1970-01-01 00:00) but the beginning of the 20th century epoch (1900-01-01 00:00) insted. So these timestamps are not the same as in NTP. This time representation is used in RTPS messages. This is called Time_t in the RTPS spec.
Implementations
impl Timestamp
[src]
pub const TIME_ZERO: Timestamp
[src]
pub const TIME_INVALID: Timestamp
[src]
pub const TIME_INFINITE: Timestamp
[src]
pub fn now() -> Timestamp
[src]
pub fn duration_since(&self, since: Timestamp) -> Duration
[src]
Trait Implementations
impl Clone for Timestamp
[src]
impl Copy for Timestamp
[src]
impl Debug for Timestamp
[src]
impl<'de> Deserialize<'de> for Timestamp
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Timestamp
[src]
impl Ord for Timestamp
[src]
fn cmp(&self, other: &Timestamp) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Timestamp> for Timestamp
[src]
impl PartialOrd<Timestamp> for Timestamp
[src]
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
[src]
fn lt(&self, other: &Timestamp) -> bool
[src]
fn le(&self, other: &Timestamp) -> bool
[src]
fn gt(&self, other: &Timestamp) -> bool
[src]
fn ge(&self, other: &Timestamp) -> bool
[src]
impl<'a_, C_: Context> Readable<'a_, C_> for Timestamp
[src]
fn read_from<R_: Reader<'a_, C_>>(_reader_: &mut R_) -> Result<Self, C_::Error>
[src]
fn minimum_bytes_needed() -> usize
[src]
pub fn read_from_buffer(buffer: &'a [u8]) -> Result<Self, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
[src]
Self: DefaultContext<Context = C>,
C: Default,
pub fn read_from_buffer_owned(
buffer: &[u8]
) -> Result<Self, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
[src]
buffer: &[u8]
) -> Result<Self, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
pub fn read_from_stream(
stream: impl Read
) -> Result<Self, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
[src]
stream: impl Read
) -> Result<Self, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
pub fn read_from_file(
path: impl AsRef<Path>
) -> Result<Self, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
[src]
path: impl AsRef<Path>
) -> Result<Self, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
pub fn read_from_buffer_with_ctx(
context: C,
buffer: &'a [u8]
) -> Result<Self, <C as Context>::Error>
[src]
context: C,
buffer: &'a [u8]
) -> Result<Self, <C as Context>::Error>
pub fn read_from_buffer_owned_with_ctx(
context: C,
buffer: &[u8]
) -> Result<Self, <C as Context>::Error>
[src]
context: C,
buffer: &[u8]
) -> Result<Self, <C as Context>::Error>
pub fn read_from_stream_with_ctx<S>(
context: C,
stream: S
) -> Result<Self, <C as Context>::Error> where
S: Read,
[src]
context: C,
stream: S
) -> Result<Self, <C as Context>::Error> where
S: Read,
pub fn read_from_file_with_ctx(
context: C,
path: impl AsRef<Path>
) -> Result<Self, <C as Context>::Error>
[src]
context: C,
path: impl AsRef<Path>
) -> Result<Self, <C as Context>::Error>
impl Serialize for Timestamp
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Timestamp
[src]
impl StructuralPartialEq for Timestamp
[src]
impl Sub<Duration> for Timestamp
[src]
type Output = Timestamp
The resulting type after applying the -
operator.
fn sub(self, rhs: Duration) -> Self::Output
[src]
impl Sub<Timestamp> for Timestamp
[src]
type Output = Duration
The resulting type after applying the -
operator.
fn sub(self, other: Timestamp) -> Duration
[src]
impl<C_: Context> Writable<C_> for Timestamp
[src]
fn write_to<T_: ?Sized + Writer<C_>>(
&self,
_writer_: &mut T_
) -> Result<(), C_::Error>
[src]
&self,
_writer_: &mut T_
) -> Result<(), C_::Error>
pub fn write_to_buffer(
&self,
buffer: &mut [u8]
) -> Result<(), <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
[src]
&self,
buffer: &mut [u8]
) -> Result<(), <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
pub fn write_to_vec(&self) -> Result<Vec<u8, Global>, <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
[src]
Self: DefaultContext<Context = C>,
C: Default,
pub fn write_to_stream<S>(&self, stream: S) -> Result<(), <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
S: Write,
[src]
Self: DefaultContext<Context = C>,
C: Default,
S: Write,
pub fn write_to_file(
&self,
path: impl AsRef<Path>
) -> Result<(), <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
[src]
&self,
path: impl AsRef<Path>
) -> Result<(), <C as Context>::Error> where
Self: DefaultContext<Context = C>,
C: Default,
pub fn write_to_buffer_with_ctx(
&self,
context: C,
buffer: &mut [u8]
) -> Result<(), <C as Context>::Error>
[src]
&self,
context: C,
buffer: &mut [u8]
) -> Result<(), <C as Context>::Error>
pub fn write_to_vec_with_ctx(
&self,
context: C
) -> Result<Vec<u8, Global>, <C as Context>::Error>
[src]
&self,
context: C
) -> Result<Vec<u8, Global>, <C as Context>::Error>
pub fn write_to_stream_with_ctx<S>(
&self,
context: C,
stream: S
) -> Result<(), <C as Context>::Error> where
S: Write,
[src]
&self,
context: C,
stream: S
) -> Result<(), <C as Context>::Error> where
S: Write,
pub fn write_to_file_with_ctx(
&self,
context: C,
path: impl AsRef<Path>
) -> Result<(), <C as Context>::Error>
[src]
&self,
context: C,
path: impl AsRef<Path>
) -> Result<(), <C as Context>::Error>
pub fn bytes_needed(&self) -> Result<usize, <C as Context>::Error>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Timestamp
[src]
impl Send for Timestamp
[src]
impl Sync for Timestamp
[src]
impl Unpin for Timestamp
[src]
impl UnwindSafe for Timestamp
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,