Struct coarsetime::Duration
[−]
[src]
pub struct Duration(_);
A duration type to represent an approximate span of time
Methods
impl Duration
[src]
fn new(sec: u64, nanos: u32) -> Duration
[src]
Creates a new Duration
from the specified number of seconds and additional nanosecond
precision
fn from_secs(sec: u64) -> Duration
[src]
Creates a new Duration from the specified number of seconds
fn from_millis(millis: u64) -> Duration
[src]
Creates a new Duration from the specified number of milliseconds
fn as_secs(&self) -> u64
[src]
Returns the number of whole seconds represented by this duration
fn subsec_nanos(&self) -> u32
[src]
Returns the nanosecond precision represented by this duration
fn as_f64(&self) -> f64
[src]
Returns the duration as a floating point number, representing the number of seconds
Trait Implementations
impl Copy for Duration
[src]
impl Clone for Duration
[src]
fn clone(&self) -> Duration
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Duration
[src]
impl Hash for Duration
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Ord for Duration
[src]
fn cmp(&self, __arg_0: &Duration) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Eq for Duration
[src]
impl PartialOrd for Duration
[src]
fn partial_cmp(&self, __arg_0: &Duration) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Duration) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Duration) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Duration) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Duration) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq for Duration
[src]
fn eq(&self, __arg_0: &Duration) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Duration) -> bool
[src]
This method tests for !=
.
impl Default for Duration
[src]
impl Add for Duration
[src]
type Output = Duration
The resulting type after applying the +
operator.
fn add(self, rhs: Duration) -> Duration
[src]
Performs the +
operation.
impl AddAssign for Duration
[src]
fn add_assign(&mut self, rhs: Duration)
[src]
Performs the +=
operation.
impl Sub for Duration
[src]
type Output = Duration
The resulting type after applying the -
operator.
fn sub(self, rhs: Duration) -> Duration
[src]
Performs the -
operation.
impl SubAssign for Duration
[src]
fn sub_assign(&mut self, rhs: Duration)
[src]
Performs the -=
operation.
impl Mul<u32> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
fn mul(self, rhs: u32) -> Duration
[src]
Performs the *
operation.
impl MulAssign<u32> for Duration
[src]
fn mul_assign(&mut self, rhs: u32)
[src]
Performs the *=
operation.
impl Div<u32> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
fn div(self, rhs: u32) -> Duration
[src]
Performs the /
operation.
impl DivAssign<u32> for Duration
[src]
fn div_assign(&mut self, rhs: u32)
[src]
Performs the /=
operation.