[−][src]Struct fake_clock::FakeClock
Struct representing a fake instant
Implementations
impl FakeClock
[src]
pub fn set_time(time: u64)
[src]
Sets the thread-local fake time to the given value
pub fn advance_time(millis: u64)
[src]
Advances the thread-local fake time by the given amount of milliseconds
pub fn time() -> u64
[src]
Returns the current thread-local fake time
pub fn now() -> Self
[src]
Returns a FakeClock
instance representing the current instant.
pub fn duration_since(&self, earlier: &Self) -> Duration
[src]
Returns the duration that passed between self
and earlier
.
pub fn elapsed(&self) -> Duration
[src]
Returns how much fake time has elapsed since the creation of self
.
Trait Implementations
impl Add<Duration> for FakeClock
[src]
type Output = FakeClock
The resulting type after applying the +
operator.
fn add(self, other: Duration) -> FakeClock
[src]
impl Clone for FakeClock
[src]
impl Copy for FakeClock
[src]
impl Debug for FakeClock
[src]
impl Eq for FakeClock
[src]
impl Ord for FakeClock
[src]
fn cmp(&self, other: &FakeClock) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<FakeClock> for FakeClock
[src]
impl PartialOrd<FakeClock> for FakeClock
[src]
fn partial_cmp(&self, other: &FakeClock) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Sub<Duration> for FakeClock
[src]
type Output = FakeClock
The resulting type after applying the -
operator.
fn sub(self, other: Duration) -> FakeClock
[src]
impl Sub<FakeClock> for FakeClock
[src]
Auto Trait Implementations
impl RefUnwindSafe for FakeClock
impl Send for FakeClock
impl Sync for FakeClock
impl Unpin for FakeClock
impl UnwindSafe for FakeClock
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> 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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,