std::future — core future trait. tokio::time::sleep — async sleep.
std::future:
tokio::time::sleep:
1use std::future::Future;23fn my_future() -> impl Future<Output = i32> {4 async { 42 }5}67use tokio::time::{sleep, Duration};8sleep(Duration::from_secs(1)).await;
Key: std::future for core, tokio for specific operations.