Skip to main content

within

Function within 

Source
pub async fn within<F, Fut, T>(
    timeout: Duration,
    body: F,
) -> Result<T, TestProbeError>
where F: FnOnce(Duration) -> Fut, Fut: Future<Output = Result<T, TestProbeError>>,
Expand description

Run body with the given budget, returning TestProbeError::Timeout if it does not finish in time.

body receives the original Duration so it can pass it down to expect_msg-style helpers and have them inherit the deadline.