pub trait StoppedTime: TimeNow {
    // Required methods
    fn local_set(unix_time: &DurationSinceUnixEpoch);
    fn local_set_to_app_start_time();
    fn local_set_to_system_time_now();
    fn local_add(duration: &Duration) -> Result<(), IntErrorKind>;
    fn local_sub(duration: &Duration) -> Result<(), IntErrorKind>;
    fn local_reset();

    // Provided method
    fn local_set_to_unix_epoch() { ... }
}
Expand description

Trait for types that can be used as a timestamp clock stopped at a given time.

Required Methods§

source

fn local_set(unix_time: &DurationSinceUnixEpoch)

It sets the clock to a given time.

source

fn local_set_to_app_start_time()

It sets the clock to the time the application started.

source

fn local_set_to_system_time_now()

It sets the clock to the current system time.

source

fn local_add(duration: &Duration) -> Result<(), IntErrorKind>

It adds a Duration to the clock.

Errors

Will return IntErrorKind if duration would overflow the internal Duration.

source

fn local_sub(duration: &Duration) -> Result<(), IntErrorKind>

It subtracts a Duration from the clock.

Errors

Will return IntErrorKind if duration would underflow the internal Duration.

source

fn local_reset()

It resets the clock to default fixed time that is application start time (or the unix epoch when testing).

Provided Methods§

source

fn local_set_to_unix_epoch()

It sets the clock to the Unix Epoch.

Implementors§