Function libp2p_rs::runtime::task::timeout[][src]

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.