pub fn in_runtime() -> bool
Whether the calling thread is inside a tokio runtime context: a runtime worker, the thread in a block_on, a blocking-pool thread, or a thread that entered a handle.
block_on