Struct async_speed_limit::clock::ManualClock [−][src]
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
impl ManualClock
[src][−]
pub fn new() -> Self
[src][−]
Creates a new clock with time set to 0.
pub fn set_time(&self, time: Nanoseconds)
[src][−]
Trait Implementations
impl Clock for ManualClock
[src][+]
impl Clone for ManualClock
[src][+]
impl Debug for ManualClock
[src][+]
impl Default for ManualClock
[src][+]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,