[][src]Function actix_testing::block_fn

pub fn block_fn<F, R>(f: F) -> Result<R::Item, R::Error> where
    F: FnOnce() -> R,
    R: IntoFuture

Runs the provided function, blocking the current thread until the result future completes.

This function can be used to synchronously block the current thread until the provided future has resolved either successfully or with an error. The result of the future is then returned from this function call.

Note that this function is intended to be used only for testing purpose. This function panics on nested call.