async_sleep::timeout

Function timeout

Source
pub fn timeout<SLEEP, T>(
    dur: Duration,
    future: T,
) -> impl Future<Output = Result<T::Output, Error>>
where SLEEP: Sleepble, T: Future + Unpin,