pub struct Duration { /* private fields */ }Expand description
Duration is an interval of time
Durations can handle lengths of time about 40 times as long as the age of the universe, and have attosecond (10^-18) precision.
Negative values are supported.
Stored in 128 bits.
Implementations§
Source§impl Duration
impl Duration
Sourcepub fn new(secs: i64, attos: i64) -> Self
pub fn new(secs: i64, attos: i64) -> Self
Make a new Duration with given number of seconds and attoseconds.
Sourcepub const fn seconds_part(&self) -> i64
pub const fn seconds_part(&self) -> i64
The seconds part
Sourcepub const fn attos_part(&self) -> i64
pub const fn attos_part(&self) -> i64
The sub-second attoseconds part
Trait Implementations§
Source§impl Ord for Duration
impl Ord for Duration
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 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