pub async fn timed<F, T>(duration: Duration, future: F) -> Result<T, Error> where
    F: Future<Output = T> + Unpin