[−][src]Struct coarsetime::Duration
A duration type to represent an approximate span of time
Methods
impl Duration[src]
pub fn new(sec: u64, nanos: u32) -> Duration[src]
Creates a new Duration from the specified number of seconds and additional nanosecond
precision
pub fn from_secs(sec: u64) -> Duration[src]
Creates a new Duration from the specified number of seconds
pub fn from_millis(millis: u64) -> Duration[src]
Creates a new Duration from the specified number of milliseconds
pub fn as_secs(&self) -> u64[src]
Returns the number of whole seconds represented by this duration
pub fn subsec_nanos(&self) -> u32[src]
Returns the nanosecond precision represented by this duration
pub fn as_f64(&self) -> f64[src]
Returns the duration as a floating point number, representing the number of seconds
Trait Implementations
impl Into<Duration> for Duration[src]
impl Eq for Duration[src]
impl Copy for Duration[src]
impl PartialOrd<Duration> for Duration[src]
fn partial_cmp(&self, other: &Duration) -> Option<Ordering>[src]
fn lt(&self, other: &Duration) -> bool[src]
fn le(&self, other: &Duration) -> bool[src]
fn gt(&self, other: &Duration) -> bool[src]
fn ge(&self, other: &Duration) -> bool[src]
impl Default for Duration[src]
impl PartialEq<Duration> for Duration[src]
impl From<Duration> for Duration[src]
impl Clone for Duration[src]
fn clone(&self) -> Duration[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Ord for Duration[src]
fn cmp(&self, other: &Duration) -> Ordering[src]
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self[src]
clamp)Restrict a value to a certain interval. Read more
impl Debug for Duration[src]
impl Add<Duration> for Duration[src]
type Output = Duration
The resulting type after applying the + operator.
fn add(self, rhs: Duration) -> Duration[src]
impl Add<Duration> for Instant[src]
type Output = Instant
The resulting type after applying the + operator.
fn add(self, rhs: Duration) -> Instant[src]
impl Sub<Duration> for Duration[src]
type Output = Duration
The resulting type after applying the - operator.
fn sub(self, rhs: Duration) -> Duration[src]
impl Sub<Duration> for Instant[src]
type Output = Instant
The resulting type after applying the - operator.
fn sub(self, rhs: Duration) -> Instant[src]
impl Mul<u32> for Duration[src]
type Output = Duration
The resulting type after applying the * operator.
fn mul(self, rhs: u32) -> Duration[src]
impl Div<u32> for Duration[src]
type Output = Duration
The resulting type after applying the / operator.
fn div(self, rhs: u32) -> Duration[src]
impl AddAssign<Duration> for Duration[src]
fn add_assign(&mut self, rhs: Duration)[src]
impl AddAssign<Duration> for Instant[src]
fn add_assign(&mut self, rhs: Duration)[src]
impl SubAssign<Duration> for Duration[src]
fn sub_assign(&mut self, rhs: Duration)[src]
impl SubAssign<Duration> for Instant[src]
fn sub_assign(&mut self, rhs: Duration)[src]
impl MulAssign<u32> for Duration[src]
fn mul_assign(&mut self, rhs: u32)[src]
impl DivAssign<u32> for Duration[src]
fn div_assign(&mut self, rhs: u32)[src]
impl Hash for Duration[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,