pub trait ExpectableStateExt: ExpectableState + Sized {
// Required method
fn when_satisfied(
&self,
expectation: Predicate<Self::State>,
timeout: MonotonicDuration,
) -> BoxFuture<'_, Result<Self::State, Error>>;
}
Required Methods§
Sourcefn when_satisfied(
&self,
expectation: Predicate<Self::State>,
timeout: MonotonicDuration,
) -> BoxFuture<'_, Result<Self::State, Error>>
fn when_satisfied( &self, expectation: Predicate<Self::State>, timeout: MonotonicDuration, ) -> BoxFuture<'_, Result<Self::State, Error>>
Convenience method for awaiting expectations on the underlying state Provides a simple syntax for asynchronously awaiting expectations:
ⓘ
// Wait for the action to have completed one way or the other
let state = state.when_satisfied(action_complete, timeout).await?;
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.