pub async fn timeout_after<R, F: Future<Output = R> + Unpin>(
timeout: MonotonicDuration,
main_future: &mut F,
) -> Result<R, ()>
Expand description
This function returns Ok(r)
, where r
is the return value from main_future
,
if main_future
completes before the timeout
duration. Otherwise, Err(())
is returned.