Skip to main content

spawn_with

Function spawn_with 

Source
pub fn spawn_with<T, U, F, S>(f: F) -> (Spawn<S>, Handle<T, U>)
where F: Fn(Mock<T, U>) -> S,
Expand description

Create a mock Service, pass it through f, and spawn the result on a mock task.

This is like spawn(), but the closure f may wrap the Mock in additional middleware before it is spawned.