Skip to main content

AsyncTimeoutConditionWaiter

Trait AsyncTimeoutConditionWaiter 

Source
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§

Source

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,

Returns a future that waits until the predicate becomes true or times out.

The timeout budget is measured from this method call.

Source

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,

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§

Source§

impl<T: Send> AsyncTimeoutConditionWaiter for ArcMockMonitor<T>

Available on crate feature async only.
Source§

impl<T: Send> AsyncTimeoutConditionWaiter for ArcTokioMonitor<T>

Source§

impl<T: Send> AsyncTimeoutConditionWaiter for MockMonitor<T>

Available on crate feature async only.
Source§

impl<T: Send> AsyncTimeoutConditionWaiter for TokioMonitor<T>