Cannot use Rayon's `.par_iter()`
<p>I have a struct which implements <code>Iterator</code> and it works fine as an iterator. It produces values, and using <code>.map()</code>, I download each item from a local HTTP server and save the results. I now want to parallelize this operation, and <a href="https://github.com/nikomatsakis/rayon" rel="noreferrer">Rayon</a> looks friendly.</p>

<p>I am getting a compiler error when trying to follow the example in the documentation.</p>

<p>This is the code that works sequentially. <code>generate_values</code> returns the struct which implements <code>Iterator</code>. <code>dl</code> downloads the values and saves them (i.e. it has side effects). Since iterators are lazy in Rust, I have put a <code>.count()</code> at the end so that it will actually run it.</p>

<pre><code>generate_values(14).map(|x| { dl(x, &amp;path, &amp;upstream_url); }).count();
</code></pre>

<p>Following the Rayon example I tried this:</p>

<pre><code>generate_values(14).par_iter().map(|x| { dl(x, &amp;path, &amp;upstream_url); }).count();
</code></pre>

<p>and got the following error:</p>

<pre><code>src/main.rs:69:27: 69:37 error: no method named `par_iter` found for type `MyIterator` in the current scope
</code></pre>

<p>Interestingly, when I use <code>.iter()</code>, which many Rust things use, I get a similar error:</p>

<pre><code>src/main.rs:69:27: 69:33 error: no method named `iter` found for type `MyIterator` in the current scope
src/main.rs:69     generate_values(14).iter().map(|tile| { dl_tile(tile, &amp;tc_path, &amp;upstream_url); }).count();
</code></pre>

<p>Since I implement <code>Iterator</code>, I should get <code>.iter()</code> for free right? Is this why <code>.par_iter()</code> doesn't work?</p>

<p>Rust 1.6 and Rayon 0.3.1</p>

<pre><code>$ rustc --version
rustc 1.6.0 (c30b771ad 2016-01-19)
</code></pre>