Struct time::SteadyTime
source · [−]pub struct SteadyTime(_);
Expand description
A structure representing a moment in time.
SteadyTime
s are generated by a “steady” clock, that is, a clock which
never experiences discontinuous jumps and for which time always flows at
the same rate.
Examples
Repeatedly call a function for 1 second:
let start = SteadyTime::now();
while SteadyTime::now() - start < Duration::seconds(1) {
do_some_work();
}
Implementations
sourceimpl SteadyTime
impl SteadyTime
sourcepub fn now() -> SteadyTime
pub fn now() -> SteadyTime
Returns a SteadyTime
representing the current moment in time.
Trait Implementations
sourceimpl Add<Duration> for SteadyTime
impl Add<Duration> for SteadyTime
type Output = SteadyTime
type Output = SteadyTime
The resulting type after applying the +
operator.
sourcefn add(self, other: Duration) -> SteadyTime
fn add(self, other: Duration) -> SteadyTime
Performs the +
operation. Read more
sourceimpl Clone for SteadyTime
impl Clone for SteadyTime
sourcefn clone(&self) -> SteadyTime
fn clone(&self) -> SteadyTime
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SteadyTime
impl Debug for SteadyTime
sourceimpl Display for SteadyTime
impl Display for SteadyTime
sourceimpl Ord for SteadyTime
impl Ord for SteadyTime
sourceimpl PartialEq<SteadyTime> for SteadyTime
impl PartialEq<SteadyTime> for SteadyTime
sourcefn eq(&self, other: &SteadyTime) -> bool
fn eq(&self, other: &SteadyTime) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SteadyTime) -> bool
fn ne(&self, other: &SteadyTime) -> bool
This method tests for !=
.
sourceimpl PartialOrd<SteadyTime> for SteadyTime
impl PartialOrd<SteadyTime> for SteadyTime
sourcefn partial_cmp(&self, other: &SteadyTime) -> Option<Ordering>
fn partial_cmp(&self, other: &SteadyTime) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Sub<Duration> for SteadyTime
impl Sub<Duration> for SteadyTime
type Output = SteadyTime
type Output = SteadyTime
The resulting type after applying the -
operator.
sourcefn sub(self, other: Duration) -> SteadyTime
fn sub(self, other: Duration) -> SteadyTime
Performs the -
operation. Read more
sourceimpl Sub<SteadyTime> for SteadyTime
impl Sub<SteadyTime> for SteadyTime
impl Copy for SteadyTime
impl Eq for SteadyTime
impl StructuralEq for SteadyTime
impl StructuralPartialEq for SteadyTime
Auto Trait Implementations
impl RefUnwindSafe for SteadyTime
impl Send for SteadyTime
impl Sync for SteadyTime
impl Unpin for SteadyTime
impl UnwindSafe for SteadyTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more