pub trait AsyncConditionWaiter {
type State;
// Required method
fn wait_while_async<'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;
// Provided method
fn wait_until_async<'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 wait_while_async<'a, R, P, F>(
&'a self,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, R>
fn wait_while_async<'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.
Provided Methods§
Sourcefn wait_until_async<'a, R, P, F>(
&'a self,
predicate: P,
action: F,
) -> AsyncMonitorFuture<'a, R>
fn wait_until_async<'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.
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.