Skip to main content

drive_fn

Function drive_fn 

Source
pub fn drive_fn<A, F>(f: F) -> AsyncFnDriver<F, A>
where A: for<'a> Arbitrary<'a>, F: AsyncFnMut(A) -> ControlFlow<()>,
Expand description

Construct a Driver from an AsyncFnMut.

Use this when the driver needs .await (e.g. tx.send(item).await).

The async function receives an arbitrary argument and returns ControlFlow<()>:

  • ControlFlow::Continue(()) - progress made, future should be polled
  • ControlFlow::Break(()) - driver is done