Skip to main content

timeout

Function timeout 

Source
pub async fn timeout<F, T>(
    duration: Duration,
    future: F,
) -> Result<T, TimeoutError>
where F: Future<Output = T>,
Expand description

Run a future with a timeout.

  • Native: Uses tokio::time::timeout.
  • WASM: Races the future against gloo_timers::future::sleep.