title: How do I integrate warp with async libraries?
body: <p>Warp has a paradigm like this,</p>
  <pre class="lang-rust prettyprint-override"><code>let hi = warp::path(&quot;hello&quot;)
      .and(warp::path::param())
      .and(warp::header(&quot;user-agent&quot;))
      .map(|param: String, agent: String| {
          format!(&quot;Hello {}, whose agent is {}&quot;, param, agent)
      });
  </code></pre>
  <p>Those filters provide <a href="https://docs.rs/warp/0.3.1/warp/trait.Filter.html#method.map" rel="nofollow noreferrer"><code>.map()</code></a> which allows you call a closure with the extracted value (output from prior filter).</p>
  <p>How do I operate within this paradigm if in the above example I want to do something like this,</p>
  <pre><code>.map(async |param: String, agent: String| {
      foo(&amp;param).await?;
      format!(&quot;Hello {}, whose agent is {}&quot;, &amp;param, agent)
  });
  </code></pre>
  <p>When I use async functions in a closure in the filter's <code>.map</code>, I get this error,</p>
  <blockquote>
  <p>error[E0708]: <code>async</code> non-<code>move</code> closures with parameters are not currently supported</p>
  </blockquote>
  <p>Is there anyway to make <code>warp</code> compatible with a library that is already async?</p>