Function ambient_api_core::global::wait_for_runtime_message
source · pub async fn wait_for_runtime_message<T: RuntimeMessage + Clone + 'static>(
is_relevant: impl Fn(&T) -> bool + 'static
) -> T
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.