pub struct MockTimer { /* private fields */ }
Expand description
A mocked timer that will assert expected waits, and block forever after it has used them.
Implementations§
Source§impl MockTimer
impl MockTimer
pub fn new() -> Self
Sourcepub fn expect_until(&mut self, time: impl Into<PartialComplexTime>)
pub fn expect_until(&mut self, time: impl Into<PartialComplexTime>)
Expect a wait until the given PartialComplexTime.
Sourcepub fn expect_for(&mut self, duration: Duration)
pub fn expect_for(&mut self, duration: Duration)
Expect a wait for the given Duration.
Sourcepub fn expect_for_range(&mut self, min: Duration, max: Duration)
pub fn expect_for_range(&mut self, min: Duration, max: Duration)
Add a new wait to the end of the expected durations.
pub fn get_requested_waits_view(&self) -> Rc<RefCell<Vec<RequestedWait>>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockTimer
impl !RefUnwindSafe for MockTimer
impl !Send for MockTimer
impl !Sync for MockTimer
impl Unpin for MockTimer
impl !UnwindSafe for MockTimer
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