pub trait AsyncTimeoutConditionWaiter: AsyncConditionWaiter {
// Required methods
fn async_wait_until_for<'a, R, P, F>(
&'a self,
timeout: Duration,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, WaitTimeoutResult<R>>
where R: Send + 'a,
P: FnMut(&Self::State) -> bool + Send + 'a,
F: FnOnce(&mut Self::State) -> R + Send + 'a;
fn async_wait_while_for<'a, R, P, F>(
&'a self,
timeout: Duration,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, WaitTimeoutResult<R>>
where R: Send + 'a,
P: FnMut(&Self::State) -> bool + Send + 'a,
F: FnOnce(&mut Self::State) -> R + Send + 'a;
}Expand description
Waits asynchronously for predicates over protected state with timeouts.
Required Methods§
Sourcefn async_wait_until_for<'a, R, P, F>(
&'a self,
timeout: Duration,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, WaitTimeoutResult<R>>
fn async_wait_until_for<'a, R, P, F>( &'a self, timeout: Duration, predicate: P, action: F, ) -> AsyncMonitorFuture<'a, WaitTimeoutResult<R>>
Returns a future that waits until the predicate becomes true or times out.
The timeout budget is measured from this method call.
Sourcefn async_wait_while_for<'a, R, P, F>(
&'a self,
timeout: Duration,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, WaitTimeoutResult<R>>
fn async_wait_while_for<'a, R, P, F>( &'a self, timeout: Duration, predicate: P, action: F, ) -> AsyncMonitorFuture<'a, WaitTimeoutResult<R>>
Returns a future that waits while the predicate remains true or times out.
The timeout budget is measured from this method call.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<T: Send> AsyncTimeoutConditionWaiter for ArcMockMonitor<T>
Available on crate feature
async only.impl<T: Send> AsyncTimeoutConditionWaiter for ArcTokioMonitor<T>
impl<T: Send> AsyncTimeoutConditionWaiter for MockMonitor<T>
Available on crate feature
async only.