pub struct Watchdog { /* private fields */ }Expand description
A guard around a call that may stop on a modal dialog.
Dropping the guard cancels it, so the normal path costs nothing:
use std::time::Duration;
use rs_teststand::Watchdog;
// Any popup the sequence raises is brought to the front, not killed.
let guard = Watchdog::start(Duration::from_secs(30), "running MainSequence");
// ... engine call ...
drop(guard); // canceled; process continuesImplementations§
Source§impl Watchdog
impl Watchdog
Sourcepub fn start(timeout: Duration, context: &'static str) -> Self
pub fn start(timeout: Duration, context: &'static str) -> Self
Starts a guard that keeps any modal dialog in front of the operator.
Equivalent to start_with under
DialogPolicy::Surface. context names the operation, so a log line
says which call was waiting rather than just that something was.
Sourcepub fn start_with(
timeout: Duration,
context: &'static str,
policy: DialogPolicy,
) -> Self
pub fn start_with( timeout: Duration, context: &'static str, policy: DialogPolicy, ) -> Self
Starts a guard with an explicit response to modal dialogs.
Use DialogPolicy::Terminate only where no one can answer a dialog and
blocking forever is the worse outcome; it ends the process.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Watchdog
impl RefUnwindSafe for Watchdog
impl Send for Watchdog
impl Sync for Watchdog
impl Unpin for Watchdog
impl UnsafeUnpin for Watchdog
impl UnwindSafe for Watchdog
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