timeout

Function timeout 

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

Awaits a future or times out after a duration of time.