pub struct ManualClock { /* private fields */ }Expand description
Manual clock for tests. Wrap Arc<ManualClock>; a test that
wants to advance the clock holds a handle next to the
RateBudget it feeds into.
Uses a Mutex<Instant> rather than atomics because the Instant
type is not trivially atomic across platforms and a test-only
code path is not where cycle-shaving matters.
Implementations§
Trait Implementations§
Source§impl Clock for ManualClock
impl Clock for ManualClock
Auto Trait Implementations§
impl !Freeze for ManualClock
impl !RefUnwindSafe for ManualClock
impl Send for ManualClock
impl Sync for ManualClock
impl Unpin for ManualClock
impl UnsafeUnpin for ManualClock
impl UnwindSafe for ManualClock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more