Function with_timeout

Source
pub async fn with_timeout<F, T>(
    future: F,
    timeout_duration: Duration,
) -> Result<T>
where F: Future<Output = T>,