pub fn block_on<F>(fut: F) -> Result<F::Output, AsyncError>
Expand description
Blocks on the provided future and returns the result.
This function is used to call async functions from sync code. Requires the current thread to be running in a tokio runtime.
Due to limitations of tokio runtime, we cannot use tokio::runtime::Runtime::block_on
if we are already inside a tokio runtime.
This function is a workaround for that limitation.