Function ambient_api::prelude::wait_for_runtime_message
source · pub async fn wait_for_runtime_message<T>(
is_relevant: impl Fn(&T) -> bool + 'static
) -> Twhere
T: RuntimeMessage + Clone + 'static,
Expand description
Stops execution of this function until the given RuntimeMessage
is received.
The is_relevant
function is used to filter out messages that are not relevant.
This must be used with .await
in either an async fn
or an async
block.