async-time-mock-smol
Asynchronous time mocking for the smol runtime 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.
ALSO NOTE: This currently implements an API that looks more like from the tokio runtime instead of smol's Timer
API. This might change in the future.
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