Skip to main content

timeout

Function timeout 

Source
pub fn timeout<F: Future>(duration: Duration, future: F) -> Timeout<F> 
Expand description

Wrap a future with a deadline. Returns Err(Elapsed) if the deadline expires before the future completes.

§Panics

Panics if called outside a runtime context.