Module clock

Source
Expand description

A Clock is a way to get the current date and time.

This module defines two implemetation of the Clock trait: SystemClock which uses the system time, and a MockClock, which can be used and freely manipulated in tests.

Structs§

MockClock
A fake clock, which uses a fixed timestamp, and can be advanced with the MockClock::advance method.
SystemClock
A clock which uses the system time

Traits§

Clock
Represents a clock which can give the current date and time