libp2p_rs::runtime::task
pub async fn timeout<F, T>(dur: Duration, f: F) -> Result<T, ()> where F: Future<Output = T>,
Awaits a future or times out after a duration of time.