How to pass closure for mocking async call?

⚓ rust    📅 2025-05-14    👤 surdeus    👁️ 5      

surdeus

Warning

This post was published 35 days ago. The information described in this article may have changed.

So that I can unit test an async call that's expensive, how can I pass the function so that my unit tests can mock it?

Here's what I have nearly working, except the argument reference causes lifetime issues I am beyond confused with:

Permalink to the playground

2 posts - 2 participants

Read full topic

🏷️ rust_feed