Function timeout

Source
pub fn timeout<T: Future + Unpin>(duration: Duration, future: T) -> Timeout<T>