Skip to main content

TestTime

Struct TestTime 

Source
pub struct TestTime;
Expand description

The virtual time of the test scheduler: ticks of 100 nanoseconds, as TimeSpan counts them.

Trait Implementations§

Source§

impl VirtualTimeClock for TestTime

Source§

fn to_system_time(absolute: i64) -> SystemTime

new DateTimeOffset(absolute, TimeSpan.Zero), measured from the epoch of the system time.

Source§

fn adjust_due_time(due_time: i64, clock: i64) -> i64

Work scheduled for now or earlier runs one tick later (TestScheduler.ScheduleAbsolute).

Source§

type Absolute = i64

The absolute time (TAbsolute).
Source§

type Relative = i64

The relative time (TRelative).
Source§

fn add(absolute: i64, relative: i64) -> i64

absolute moved by relative (Add).
Source§

fn to_relative(duration: Duration) -> i64

A duration as a relative time (ToRelative).
Source§

fn subtract(absolute: i64, duration: Duration) -> i64

absolute moved back by duration: what upstream’s Add does with the negative relative time of a due time in the past. The default keeps absolute (the past is due now).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.