pub async fn wait_for_fallible_runtime_messages<Success: RuntimeMessage + Clone + 'static, Failure: RuntimeMessage + Clone + 'static>(
is_relevant_success: impl Fn(&Success) -> bool + 'static,
is_relevant_failure: impl Fn(&Failure) -> bool + 'static
) -> Result<Success, Failure>
Expand description
Stops execution of this function until one of the given RuntimeMessage
sare received.
The is_relevant
functions are used to filter out messages that are not relevant.
This must be used with .await
in either an async fn
or an async
block.