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
Creates a new Duration
from the specified number of seconds and additional nanosecond
precision
fn from_secs(sec: u64) -> Duration
Creates a new Duration from the specified number of seconds
fn from_millis(millis: u64) -> Duration
Creates a new Duration from the specified number of milliseconds
fn as_secs(&self) -> u64
Returns the number of whole seconds represented by this duration
fn subsec_nanos(&self) -> u32
Returns the nanosecond precision represented by this duration
fn as_f64(&self) -> f64
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
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
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)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl Ord for Duration
[src]
fn cmp(&self, __arg_0: &Duration) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl Eq for Duration
[src]
impl PartialOrd for Duration
[src]
fn partial_cmp(&self, __arg_0: &Duration) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Duration) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Duration) -> bool
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
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Duration) -> bool
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
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Duration) -> bool
This method tests for !=
.
impl Add for Duration
[src]
type Output = Duration
The resulting type after applying the +
operator
fn add(self, rhs: Duration) -> Duration
The method for the +
operator
impl AddAssign for Duration
[src]
fn add_assign(&mut self, rhs: Duration)
The method for the +=
operator
impl Sub for Duration
[src]
type Output = Duration
The resulting type after applying the -
operator
fn sub(self, rhs: Duration) -> Duration
The method for the -
operator
impl SubAssign for Duration
[src]
fn sub_assign(&mut self, rhs: Duration)
The method for the -=
operator
impl Mul<u32> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator
fn mul(self, rhs: u32) -> Duration
The method for the *
operator
impl MulAssign<u32> for Duration
[src]
fn mul_assign(&mut self, rhs: u32)
The method for the *=
operator
impl Div<u32> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator
fn div(self, rhs: u32) -> Duration
The method for the /
operator
impl DivAssign<u32> for Duration
[src]
fn div_assign(&mut self, rhs: u32)
The method for the /=
operator