Skip to content

bounded

Functions

  • remove_dir - Remove a fixture directory as a named step.
  • run - Run body to completion within 120 seconds, then shut the runtime down
  • step - Await future as the named test step.

Function

Remove a fixture directory as a named step.

Removal runs on a blocking thread, so the step deadline still fires if the filesystem stalls it. Removal errors are ignored, as in [TempDir]‘s Drop.

Returns an error if removal does not finish within 10 seconds.

fn remove_dir(dir: tempfile::TempDir) -> anyhow::Result<()>

Function

Run body to completion within 120 seconds, then shut the runtime down within 10 seconds.

Authority and step logs go to the captured test output, so a failure shows the last step that started. A panic in body is resumed after teardown.

Returns the error from body, or an error if the runtime cannot be built, body exceeds its deadline, or teardown exceeds its deadline.

fn run<impl Future<Output = anyhow::Result<()>> + Send + 'static>(body: impl Trait) -> anyhow::Result<()>

Function

Await future as the named test step.

Returns an error naming the step if future does not finish within limit.

fn step<F>(name: &str, limit: std::time::Duration, future: F) -> anyhow::Result<<F as >::Output>