use std::future::Future; pub fn run_async(async_operation: impl Future) -> T { // Use `block_in_place` to ensure runtime is dropped in a blocking context tokio::task::block_in_place(|| { // Get the current Tokio runtime handle let handle = tokio::runtime::Handle::current(); // Run the async operation using the handle and wait for it to complete handle.block_on(async_operation) }) }