pub struct Duration(/* private fields */);
Expand description
A duration of time.
Implementations§
Source§impl Duration
impl Duration
Sourcepub fn from_nanos(nanos: u64) -> Self
pub fn from_nanos(nanos: u64) -> Self
Create a duration from nanoseconds.
Sourcepub fn from_micros(micros: u64) -> Self
pub fn from_micros(micros: u64) -> Self
Create a duration from microseconds.
Sourcepub fn from_millis(millis: u64) -> Self
pub fn from_millis(millis: u64) -> Self
Create a duration from milliseconds.
Sourcepub fn as_nanos_u128(self) -> u128
pub fn as_nanos_u128(self) -> u128
Get nanoseconds as u128 for calculations.
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