async-time-mock-async-std (discontinued)
NOTE: This library is discontinued because async-std
was discontinued. You can find async-time-mock-smol
for an implementation with the smol
runtime instead.
Asynchronous time mocking with an async-std compatible API based on async-time-mock-core, inspired by the approach described in Mocking Time In Async Rust.
NOTE: This library is still in it's infancy, the API is still likely to change (read: improve). Please leave your feedback and suggestions on GitHub.
Cargo features
mock
: Enable the mock clock. If you only enable this in tests, this library turns into a thin wrapper around async-std's time functions.stream
: Implementfutures_core::stream::Stream
forInterval
Example
use MockableClock;
use ;
static HAS_SLEPT: AtomicBool = new;
async
async