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 moresourceimpl 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 moresourceimpl Debug for SteadyTime
impl Debug for SteadyTime
sourceimpl Display for SteadyTime
impl Display for SteadyTime
sourceimpl Ord for SteadyTime
impl Ord for SteadyTime
sourcefn cmp(&self, other: &SteadyTime) -> Ordering
fn cmp(&self, other: &SteadyTime) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<SteadyTime> for SteadyTime
impl PartialEq<SteadyTime> for SteadyTime
sourcefn eq(&self, other: &SteadyTime) -> bool
fn eq(&self, other: &SteadyTime) -> bool
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>
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 moresourceimpl 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 moresourceimpl 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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