pub trait AsyncConditionWaiter {
type State;
// Required methods
fn async_wait_until<'a, R, P, F>(
&'a self,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, R>
where R: Send + 'a,
P: FnMut(&Self::State) -> bool + Send + 'a,
F: FnOnce(&mut Self::State) -> R + Send + 'a;
fn async_wait_while<'a, R, P, F>(
&'a self,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, 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 monitor state.
Required Associated Types§
Required Methods§
Sourcefn async_wait_until<'a, R, P, F>(
&'a self,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, R>
fn async_wait_until<'a, R, P, F>( &'a self, predicate: P, action: F, ) -> AsyncMonitorFuture<'a, R>
Returns a future that waits until the predicate becomes true.
The predicate and action run while the monitor state is locked.
Sourcefn async_wait_while<'a, R, P, F>(
&'a self,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, R>
fn async_wait_while<'a, R, P, F>( &'a self, predicate: P, action: F, ) -> AsyncMonitorFuture<'a, R>
Returns a future that waits while the predicate remains true.
The predicate and action run while the monitor state is locked.
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> AsyncConditionWaiter for ArcMockMonitor<T>
Available on crate feature async only.
impl<T: Send> AsyncConditionWaiter for ArcMockMonitor<T>
Available on crate feature
async only.Source§impl<T: Send> AsyncConditionWaiter for ArcTokioMonitor<T>
impl<T: Send> AsyncConditionWaiter for ArcTokioMonitor<T>
Source§impl<T: Send> AsyncConditionWaiter for MockMonitor<T>
Available on crate feature async only.
impl<T: Send> AsyncConditionWaiter for MockMonitor<T>
Available on crate feature
async only.