pub struct Duration {
pub seconds: i32,
pub fraction: u32,
}Expand description
A length of time in NTP format: seconds + fraction / 2^32
(DDSI-RTPS 2.5, 9.3.2.1 and 9.3.2.3).
Fields§
§seconds: i32Whole seconds.
fraction: u32Fraction of a second in units of 2^-32 s.
Implementations§
Source§impl Duration
impl Duration
Sourcepub fn to_std(self) -> Option<Duration>
pub fn to_std(self) -> Option<Duration>
Converts to a std::time::Duration. Negative values give zero;
Duration::INFINITE gives None.
Sourcepub fn from_std(d: Duration) -> Duration
pub fn from_std(d: Duration) -> Duration
Converts from a std::time::Duration, saturating at the largest
finite value.
Trait Implementations§
impl Copy for Duration
impl Eq for Duration
Source§impl Ord for Duration
impl Ord for Duration
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Duration
impl PartialOrd for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl Forget for Duration
impl Freeze for Duration
impl Move for Duration
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnsafeUnpin for Duration
impl UnwindSafe for Duration
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