pub struct Time {
pub sec: i32,
pub nanosec: u32,
}Expand description
Time_t — wall-clock timestamp since the Unix epoch.
Fields§
§sec: i32Seconds since 1970-01-01 UTC.
nanosec: u32Nanoseconds component [0, 999_999_999].
Implementations§
Source§impl Time
impl Time
Sourcepub const INVALID: Self
pub const INVALID: Self
Reserved sentinel “invalid time” (spec convention: sec=-1, nanosec=0xFFFF_FFFF).
Sourcepub const fn is_zero(&self) -> bool
pub const fn is_zero(&self) -> bool
true if the value equals the Self::ZERO sentinel.
Sourcepub const fn is_invalid(&self) -> bool
pub const fn is_invalid(&self) -> bool
true if the value equals the Self::INVALID sentinel.
Sourcepub const fn is_infinite(&self) -> bool
pub const fn is_infinite(&self) -> bool
true if the value equals the Self::INFINITE sentinel.
Sourcepub const fn seconds(&self) -> i32
pub const fn seconds(&self) -> i32
Spec §7.5.6.1 — seconds-Accessor (DDS-PSM-Cxx Time::seconds()).
Sourcepub const fn nanoseconds(&self) -> u32
pub const fn nanoseconds(&self) -> u32
Spec §7.5.6.1 — nanoseconds-Accessor.
Sourcepub fn add_duration(self, d: Duration) -> Self
pub fn add_duration(self, d: Duration) -> Self
Spec §7.5.6.2 — Time + Duration (second increment).
Sourcepub const fn from_millis(ms: i64) -> Self
pub const fn from_millis(ms: i64) -> Self
Spec §7.5.6.3 — Time from a millisecond integer.
Trait Implementations§
impl Copy for Time
impl Eq for Time
Source§impl Ord for Time
impl Ord for Time
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Time
impl PartialOrd for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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