pub trait Duration: PartialOrd<Self> + Debug + Default + Copy + Clone + Add<Self, Output = Self> {
fn from_millis(millis: u32) -> Option<Self>;
fn as_secs(&self) -> u64;
fn subsec_nanos(&self) -> u32;
}
Expand description
A duration created from the difference between two instants
Required methods
fn from_millis(millis: u32) -> Option<Self>
fn from_millis(millis: u32) -> Option<Self>
Creates a duration from a number of milliseconds
This function returns None if this duration type cannot represent the provided number of milliseconds.
fn subsec_nanos(&self) -> u32
fn subsec_nanos(&self) -> u32
Returns the fractional part of this duration in nanoseconds