pub struct Duration {
pub sec: i32,
pub nanosec: u32,
}Expand description
Duration_t — relativer Zeitraum (kann negativ sein bei
sec < 0).
Fields§
§sec: i32Seconds.
nanosec: u32Nanoseconds-Anteil [0, 999_999_999].
Implementations§
Source§impl Duration
impl Duration
Sourcepub const fn is_infinite(&self) -> bool
pub const fn is_infinite(&self) -> bool
true wenn der Wert Self::INFINITE ist.
Sourcepub const fn is_zero(&self) -> bool
pub const fn is_zero(&self) -> bool
true wenn der Wert Self::ZERO ist.
Sourcepub fn to_core(self) -> Duration
pub fn to_core(self) -> Duration
Konvertierung in core::time::Duration. INFINITE wird auf
Duration::MAX gemapped; negative Sekunden auf ZERO
(core::time::Duration ist unsigned).
Sourcepub fn from_core(d: Duration) -> Self
pub fn from_core(d: Duration) -> Self
Konvertierung von core::time::Duration (lossy, kappt
Sekunden auf i32::MAX).
Sourcepub const fn seconds(&self) -> i32
pub const fn seconds(&self) -> i32
Spec §7.5.6.1 — seconds-Accessor (DDS-PSM-Cxx Duration::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.4 — Duration + Duration (Increment).
Sourcepub const fn from_millis(ms: i64) -> Self
pub const fn from_millis(ms: i64) -> Self
Spec §7.5.6.5 — Duration aus Millisekunden-Integer.
Trait Implementations§
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
Source§impl PartialOrd for Duration
impl PartialOrd for Duration
impl Copy for Duration
impl Eq for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl Freeze 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