Struct async_speed_limit::clock::ManualClock [−][src]
pub struct ManualClock(_);
Expand description
A Clock
where the passage of time can be manually controlled.
This type is mainly used for testing behavior of speed limiter only.
This clock only supports up to 264 ns (about 584.5 years).
Examples
use async_speed_limit::clock::{Clock, ManualClock, Nanoseconds};
let clock = ManualClock::new();
assert_eq!(clock.now(), Nanoseconds(0));
clock.set_time(Nanoseconds(1_000_000_000));
assert_eq!(clock.now(), Nanoseconds(1_000_000_000));
Implementations
Trait Implementations
type Instant = Nanoseconds
type Instant = Nanoseconds
Type to represent a point of time. Read more
type Delay = ManualDelay
type Delay = ManualDelay
Future type returned by sleep()
.
Returns the current time instant. It should be monotonically increasing, but not necessarily high-precision or steady. Read more
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ManualClock
impl Send for ManualClock
impl Sync for ManualClock
impl Unpin for ManualClock
impl UnwindSafe for ManualClock
Blanket Implementations
Mutably borrows from an owned value. Read more