   let j = rx.recv().unwrap();
        assert!(0 &lt;= j &amp;&amp; j &lt; 10);
    }
    
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>thread</span>;
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>sync</span>::<span class='ident'>mpsc</span>::<span class='ident'>channel</span>;

<span class='comment'>// Create a shared channel that can be sent along from many threads</span>
<span class='comm